Skip to content

run_tests fails with errors about SaveModifiedSceneTask #382

@Redhaozzz

Description

@Redhaozzz

I'm trying to use the run_tests tool, while it always pop up below error:

InvalidOperationException: This cannot be used during play mode.
UnityEditor.SceneManagement.EditorSceneManager.SaveCurrentModifiedScenesIfUserWantsTo (System.String message) (at <45b9485b4ba64564b30d91e935218d54>:0)
UnityEditor.SceneManagement.EditorSceneManager.SaveCurrentModifiedScenesIfUserWantsTo () (at <45b9485b4ba64564b30d91e935218d54>:0)
UnityEditor.TestTools.TestRunner.TestRun.Tasks.Scene.SaveModifiedSceneTask+d__1.MoveNext () (at ./Library/PackageCache/com.unity.test-framework/UnityEditor.TestRunner/TestRun/Tasks/Scene/SaveModifiedSceneTask.cs:13)
UnityEditor.TestTools.TestRunner.TestRun.TestJobRunner.ExecuteStep () (at ./Library/PackageCache/com.unity.test-framework/UnityEditor.TestRunner/TestRun/TestJobRunner.cs:173)
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()

In same condition I can correctly run all test through the unity editor Test Runner.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions