-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Missing Pytest results due to pytest.ini location changing expected root folder #6978
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
It seems pytest wont search in child folders for pytest.ini.. when you run pytest directly from command line it wont find the pytest.ini in the subfolder, unless we tell it to run a specific test, then it changes to search that test's folder.
|
One solution might be to always pass the root folder found from discovery to the pytest execution call using |
I have verified that with a pytest.ini in the subdirectory, neither the test explorer nor the code lenses show the test results even though the test passes. |
Similar issue with azure-cli repro microsoft/PTVS#5626 |
For now VS is setting --rootdir as a command line arg for both pytest discovery and execute so that they always match. change here. microsoft/PTVS#5628 |
Bill, is there a better option than your workaround? Else we could close this (after documenting if necessary). |
I think the options could be.
|
FYI, this is related to #6548. For that issue we need to adjust how we use the "--rootdir" CLI arg to pytest. I expect it will affect the solution here. |
Fixed in |
Uh oh!
There was an error while loading. Please reload this page.
Environment data
"python.jediEnabled"
set to; more info How to update the language server to the latest stable version #3977): XXXExpected behaviour
Running a discovered test should show result icon in test viewer
Actual behaviour
Test passes in output window, but doesn't update in test viewer
Steps to reproduce:
Same issue is happening in PTVS..
discovery is running with root base folder
junitxml results have a root as subfolder and filepaths are missing "PythonApplication15" in front
cwd: c:\Users\bschnurr\source\repos\PythonApplication15
rootdir: c:\Users\bschnurr\source\repos\PythonApplication15\pythonapplication15, inifile: pytest.ini
Logs
Output for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)Output from
Console
under theDeveloper Tools
panel (toggle Developer Tools on underHelp
; turn on source maps to make any tracebacks be useful by runningEnable source map support for extension debugging
)The text was updated successfully, but these errors were encountered: