You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Folders named 'py' result in "Test result not found" #17414
This is a very specific case with folders named py. This is a problem due to the way the test runner generates test ids. We plan on addressing this in the test adapter re-write.
One more thing. It looks like parameter --rootdir in the python.testing.pytestArgs also affects behavior of test execution from the test explorer UI.
Just want remind that it should be taken into account.
If I use
"python.testing.pytestArgs": [
"./tests/py"
]
then tests are discovered, but if I try to execute those, then I am getting a message in Python Test Log: ERROR: file or directory not found: ... and the test I clicked continues to be displayed as gray (not executed)
then test are discovered, but I am getting an error described in the first message in this issue: Test result not found for: ... and the test I clicked is turning red (as on the screenshot in the first post)
Is there a workaround for this (other than renaming directories) until the fix/rewrite is released? Or are we stuck with a broken test runner until then?
Hello! We have just finished our testing rewrite and are beginning the roll out to users. I have tested this issue with the re-write and I am not longer reproducing the bug! If you would like to try it yourself, you need to be on vscode insiders and then add this setting to your users settings.json"python.experiments.optInto": ["pythonTestAdapter"]. We are in the processes of switching all users to the rewrite but are doing so incrementally so if you do not have insiders, watch our release notes to get updated on when it will begin to hit stable. Let me know if it doesn’t work for you and we can re-open this issue. Thanks!
Activity
[-]Pytest error "Test result not found for ..."[/-][+]Folders named 'py' result in "Test result not found"[/+]karthiknadig commentedon Sep 14, 2021
This is a very specific case with folders named
py. This is a problem due to the way the test runner generates test ids. We plan on addressing this in the test adapter re-write.botsman commentedon Oct 8, 2021
One more thing. It looks like parameter
--rootdirin thepython.testing.pytestArgsalso affects behavior of test execution from the test explorer UI.Just want remind that it should be taken into account.
then tests are discovered, but if I try to execute those, then I am getting a message in Python Test Log:
ERROR: file or directory not found: ...and the test I clicked continues to be displayed as gray (not executed)then test are discovered, but I am getting an error described in the first message in this issue:
Test result not found for: ...and the test I clicked is turning red (as on the screenshot in the first post)hmrd-forpeople commentedon Oct 13, 2021
Is there a workaround for this (other than renaming directories) until the fix/rewrite is released? Or are we stuck with a broken test runner until then?
karthiknadig commentedon Oct 13, 2021
@hszw-forpeople I recommend using an older version of the extension 2021.8.*, if you cannot change the name.
botsman commentedon Nov 4, 2021
Just a note, probably related to #17242
ianjirka commentedon May 12, 2022
Can confirm - renaming my directory from 'py' to '_py' works around this issue.
eleanorjboyd commentedon Jun 22, 2023
Hello! We have just finished our testing rewrite and are beginning the roll out to users. I have tested this issue with the re-write and I am not longer reproducing the bug! If you would like to try it yourself, you need to be on vscode insiders and then add this setting to your users
settings.json"python.experiments.optInto": ["pythonTestAdapter"]. We are in the processes of switching all users to the rewrite but are doing so incrementally so if you do not have insiders, watch our release notes to get updated on when it will begin to hit stable. Let me know if it doesn’t work for you and we can re-open this issue. Thanks!