Search Issue Tracker

Won't Fix

Votes

1

Found in

6000.0.59f1

6000.2.7f1

6000.3.0b4

6000.4.0a1

Issue ID

UUM-120821

Regression

No

Test Runner fails to create a script in the active path when selecting a file as the active path

-

Steps to reproduce :
1. Create a new Project
2. Open the Test Runner (Window > General > Test Runner)
3. In the Project window, create a new folder in the “Assets” folder
4. Open the created folder
5. Press “Create a new Test Assembly Folder in the active path.” in the Test Runner window
6. Open the “Tests” folder
7. Select the “Tests.asmdef” file
8. Press “Create a new Test Script in the active path.” in the Test Runner window
9. Observe the console

Expected result: A test script is created in the same directory as the selected file
Actual result: A new test script is not created and an error is thrown “Invalid generated unique path '' (input path 'Assets/Scripts/Tests/Tests.asmdef/NewTestScript.cs')”

Reproducible with: 2023.1.0a1, 6000.0.59f1, 6000.2.7f1, 6000.3.0b4, 6000.4.0a1

Reproducible on: Windows 11 Pro (24H2)
Not reproducible on: No other environments tested

Note: In com.unity.test-framework 1.4.5 the issue does not reproduce

  1. Resolution Note:

    Due to limited resources this issue was deemed to be low priority and will be closed as won’t fix. If you do not agree with this priority assessment, please reopen the bug and we will reevaluate it.

Comments (1)

  1. AltIvan

    Oct 31, 2025 23:06

    A workaround to fix this issue in Unity 6000.0.28f1 is to change the method that is throwing the error for this one:

    public void CreateScriptAssetFromTemplateFile(string defaultName, string templatePath)
    {
    defaultName = defaultName.Replace('\\', '/').Substring(0, defaultName.LastIndexOf('/')) + '/NewTestScript.cs';
    ProjectWindowUtil.CreateScriptAssetFromTemplateFile(templatePath, defaultName);
    }
    }

    ~ Ivanca

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.