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
Tests are displayed in the test explorer according to python.testing.cwd setting and I am able to run single test or tests from single file
Actual behaviour
python.testing.cwd is ignored for displaying tests and I am unable to run single test or tests from single file because I am getting an error file not found.
Steps to reproduce:
[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]
Output from Console under the Developer Tools panel (toggle Developer Tools on under Help; turn on source maps to make any tracebacks be useful by running Enable source map support for extension debugging)
console.ts:137 [Extension Host] Info Python Extension: 2019-11-20 14:06:31: getActivatedEnvironmentVariables, Class name = b, completed in 1ms, Arg 1: <Uri:/Users/pavel/projects/sample_project>, Arg 2: undefined, Arg 3: undefined
console.ts:137 [Extension Host] Info Python Extension: 2019-11-20 14:06:31: > ~/.virtualenvs/sample_project/bin/python -m pytest --rootdir ~/projects/sample_project --junitxml=/var/folders/0_/6w94lk1171vc_fpwbjqx02nw0000gn/T/tmp-5598WI4lpp4kFEsC.xml -v -s --log-cli-level INFO ./tests/py/some_test.py::test_something
console.ts:137 [Extension Host] Info Python Extension: 2019-11-20 14:06:31: cwd: ~/projects/sample_project/tests/py
Additional info
Looks like something has changed in the last release:
Previously tests would be displayed in the test explorer just as some_test.py would be root test. I mean that tests/py would be omitted in the test explorer since I have "python.testing.cwd": "tests/py" in my settings.
Currently directories tests/py are displayed in the test explorer even though I have this setting.
I can't run single test because I am always getting an error file not found. It looks like something is wrong with the file paths.
When the command ~/.virtualenvs/sample_project/bin/python -m pytest --rootdir ~/projects/sample_project --junitxml=/var/folders/0_/6w94lk1171vc_fpwbjqx02nw0000gn/T/tmp-5598WI4lpp4kFEsC.xml -v -s --log-cli-level INFO ./tests/py/some_test.py::test_something
is called my current working directory is set to python.testing.cwd and that is why I am getting the error.
So in the command mentioned above valid file path should be ./some_test.py::test_something, not ./tests/py/some_test.py::test_something.
Environment data
"python.jediEnabled"set to; more info How to update the language server to the latest stable version #3977): JediExpected behaviour
Tests are displayed in the test explorer according to
python.testing.cwdsetting and I am able to run single test or tests from single fileActual behaviour
python.testing.cwdis ignored for displaying tests and I am unable to run single test or tests from single file because I am getting an errorfile not found.Steps to reproduce:
[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]
Sample project: https://github.com/pbotsman/sample_project
test_somethingor tests insome_test.pyfile.(Sometimes in order to reproduce the problem I had to relaunch my VSCode)
Logs
Output for
Pythonin theOutputpanel (View→Output, change the drop-down the upper-right of theOutputpanel toPython)Output from
Consoleunder theDeveloper Toolspanel (toggle Developer Tools on underHelp; turn on source maps to make any tracebacks be useful by runningEnable source map support for extension debugging)Additional info
Looks like something has changed in the last release:
some_test.pywould be root test. I mean thattests/pywould be omitted in the test explorer since I have"python.testing.cwd": "tests/py"in my settings.Currently directories
tests/pyare displayed in the test explorer even though I have this setting.file not found. It looks like something is wrong with the file paths.When the command
~/.virtualenvs/sample_project/bin/python -m pytest --rootdir ~/projects/sample_project --junitxml=/var/folders/0_/6w94lk1171vc_fpwbjqx02nw0000gn/T/tmp-5598WI4lpp4kFEsC.xml -v -s --log-cli-level INFO ./tests/py/some_test.py::test_somethingis called my current working directory is set to
python.testing.cwdand that is why I am getting the error.So in the command mentioned above valid file path should be
./some_test.py::test_something, not./tests/py/some_test.py::test_something.