So for some reason, when running unit tests, they do not “work”, the unit test code runs fine, even asserts run and execute, because I have added logging to the test methods.
The test scene is started, tests run, and then nothing, the play mode stays as is and there is no further action from the TestRunner.
You can see, the unit test does not fail nor complete, but if you look at console, the code has executed just fine.
public class LootSpawnerTests
{
[UnityTest]
public IEnumerator WeightedLoot_NoLoot()
{
Debug.Log("a");
yield return null;
Debug.Log("b");
yield return null;
Assert.True(true);
Debug.Log("c");
}
}
- using Unity 2022.3.14 LTS
- using 1.1.13 Test Framework package
- tried restarting editor several times
- tried EditMode tests, they seem to run fine, only PlayMode tests have this issue
- tried even with single yield return null, did not help
- tried using Assert.
Another showcase of more tests, these ones were working year back, you can see play mode is just sitting there