forked from DonJayamanne/pythonVSCode
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Labels
area-testingbugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bug
Description
Environment data
- VS Code version: 1.30.2
- Extension version (available under the Extensions sidebar): 2018.12.1
- Relevant/affected Python packages and their versions: pytest 3.9.1
Expected behaviour
Tests are discovered correctly
Actual behaviour
Any package causes subsequently discovered tests to be considered IN the package
Steps to reproduce:
- Create a tests folder
- Create test/testa/test_first.py test/testc/test_last.py with regular python tests (any function will suffice)
- Create test/testb/init.py and test/testb/test_second.py with a python test function
- Run discover tests
Logs
Example pytest output:
============================= test session starts ==============================
platform linux -- Python 3.6.0, pytest-3.9.1, py-1.7.0, pluggy-0.8.0
Using --randomly-seed=1547049040
rootdir: /home/alex/git/HP-DLF, inifile:
plugins: repeat-0.7.0, randomly-1.2.3, profiling-1.3.0, cov-2.6.0, console-scripts-0.1.7, nbval-0.9.1
collected 3 items
<Module 'test/testa/test_first.py'>
<Function 'test_foo'>
<Package '/home/.../test/testb'>
<Module 'test_second.py'>
<Function 'test_foo'>
<Module 'test/testc/test_last.py'>
<Function 'test_foo'>
========================= no tests ran in 0.11 seconds =========================
The test output parser will report the last one in file /home/.../test/testb/test/testc/test_last.py which is clearly wrong.
Reason is that the packagePrefix is not reset
Metadata
Metadata
Assignees
Labels
area-testingbugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bug