-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Can't run test using Test Function, Test File, Test Module, only Run All Tests works #7747
Comments
Please paste your |
Yes, it seems that my problem is related to the #6548.
It is interesting that after removing both But I am wondering , why it was working in the previous version of |
Earlier we were calling pytest to do the discovery and then scraping the output to get the results. But pytest changed the output format unexpectedly due which parsing the output in the extension failed. So we now have our pytest adapter code in the extension for the discovery, so that we don't have to be dependent on the pytest output. But it led to issues like this, so it still needs some work. Anyways, closing this issue as dup of #6548 |
Environment data
Version: 1.38.1
Commit: b37e54c98e1a74ba89e03073e5a3761284e3ffb0
Date: 2019-09-11T13:31:32.854Z
Electron: 4.2.10
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Darwin x64 18.7.0
-Type of virtual environment used (N/A | venv | virtualenv | conda | ...): virtualenv
Expected behaviour
I can press "Run Test" above the pytest function and test will be executed
Actual behaviour
After pressing the "Run Test" I can see error notifications:
FILE_PATH_HERE indeed is not exists, but I can see that path is crafter incorrectly.
Real file path(some names changed) - /Users/username/src/WORKSPACE/SUBDIR/tests/handlers/dir/test_foo.py
FILE_PATH_HERE - /Users/username/src/WORKSPACE/tests/handlers/dir/test_foo.py
So, SUBDIR is lost and due to that path is invlalid.
Other notes
Want to note that I am using a python project with 3 subprojects(SUBDIRs) inside, each of them has it's on Pipfile. I set up vscode python interpreter to be python from one of these subprojects virtualenvs. This interpreter has all other subprojects installed as packages, so it can use them(import code from them).
In the Output -> "Python" I can see:
So, I can see that the problem is caused because for some reasons vscode-python is choosing the wrong relative path, when running function test. So, it is basically, building relative path not from WORKSPACE, but from WORKSPACE/SUBDIR/.
I can see this problem when I am running test for single function and for whole module too.
But, I can run all the test using "Run All Tests" button. So, the only option to execute tests it is only run all of them.
Also, I can say that in the previous vscode-python build (maybe month ago) that feature with running single function test was working, so it seems to be broken recently.
The text was updated successfully, but these errors were encountered: