Search Unity

Debug.LogError does not stop run

Discussion in 'Testing & Automation' started by andysaia, Jun 24, 2021.

  1. andysaia

    andysaia

    Joined:
    Nov 2, 2015
    Posts:
    21
    I have a setup where my playmode tests loads a new scene. If one of those scripts in that new scene logs an error using Debug.LogError(...) the test does not stop. In my case the test just gets stuck.

    From reading the docs it sounds like the error log will fail the build but should it stop it as well?
    A test fails if Unity logs a message other than a regular log or warning message

    https://docs.unity3d.com/Packages/c...al/reference-custom-assertion.html?q=logError

    using 1.1.26 of Test Framework package
     
    Last edited: Jun 24, 2021
  2. andysaia

    andysaia

    Joined:
    Nov 2, 2015
    Posts:
    21
    So I think what might be happening in my case is the TearDown script actually has an error. Which instead of failing the test just gets it stuck.