vscode-python-test-adapter icon indicating copy to clipboard operation
vscode-python-test-adapter copied to clipboard

incorrect test file paths when pytest.ini is in the parent of the workspace folder

Open ws1088 opened this issue 4 years ago • 1 comments

if I add a folder with tests into a workspace and there is no pytest.ini in that folder and the pytest.ini is in the folder parent directory, test explorer will fail to display the source file and run the tests. Test discovery will work.

Workaround: add a symbolic link of the parent's pytest.ini to the folder will make it work.

FYI the vscode default testing pane/GUI works without the workaround.

ws1088 avatar Jun 23 '21 15:06 ws1088

image Example attached[ bug.zip ](url) open bug.code-workspace and use pytest to discover the tests. try clicking the discovered test (by Python Test Explorer) and you will notice that it fail to open the file (test_me.py). Using the vscode default test GUI you can open the file.

Since the file path is incorrect, Python Test Explorer is not able to run the test (confirmed from the output window), while the vscode default GUI can run it with no issues.

ws1088 avatar Jun 24 '21 03:06 ws1088