EditorSceneManager.playModeStartScene API breaks playmode tests

Hi,

I just discovered the EditorSceneManager.playModeStartScene API Unity - Scripting API: SceneManagement.EditorSceneManager.playModeStartScene which has allowed me to simplify my bootstrapping process however, I’ve noticed that when this field is set to a scene it breaks the test runner. The test runner starts and creates the test scene that Unity creates but the actual tests never run as the scene is replaced with the scene defined in the EditorSceneManager.playModeStartScene API.

Is there any way to use this API and have the testing framework work?

I found this ticket but it is listed as wont fix?

I’m using the latest testing framework package 1.4.5

Thanks.

EDIT:

I’ve found a work around for the time being where I use the IPrebuildSetup, IPostBuildCleanup callbacks on the tests to remove the startup scene and restore it once tests have been finished.

public class BaseRuntimeTests : SceneTestFixture, IPrebuildSetup, IPostBuildCleanup
{
	private static SceneAsset s_startingScene;
	
	public void Setup()
	{
		s_startingScene = EditorSceneManager.playModeStartScene;
		EditorSceneManager.playModeStartScene = null;
	}
	
	public void Cleanup()
	{
		EditorSceneManager.playModeStartScene = s_startingScene;
		s_startingScene = null;
	}
}