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 bugverification-neededVerification of issue is requestedVerification of issue is requestedverifiedVerification succeededVerification succeeded
Milestone
Description
Issue Type: Bug
At the moment, files are filtered from pytestArgs before test discovery is run. This is unexpected for a user and could lead to issues:
- Not all tests will be found
Given a file tree andpytestArgs
tests/
├── dir
│ └── test_b.py
├── helpers
│ └── test_c.py
└── test_a.py
"python.testing.pytestArgs": [
"tests/dir",
"tests/helpers/test_c.py",
],
tests/helpers/test_c.py would be filtered and only tests inside of tests/dir would be discovered.
- pytest discovery failing completely
In large projects it's possible that different test subfolders require different dependencies viaconftest.py. Not all of them might be installed. If the desire was to only discover tests intests/dir/test_b.py, having that argument filtered would mean that discovery is run from root and thus allconftest.pyfiles are loaded. If the test is inside a subfolder, it's possible to work around it by removing the filename. However that doesn't work for tests inside the root test directory.
Extension version: 2022.0.1814523869
VS Code version: Code 1.64.2 (f80445acd5a3dadef24aa209168452a3d97cc326, 2022-02-09T22:00:58.347Z)
OS version: Darwin x64 19.6.0
Restricted Mode: No
Metadata
Metadata
Assignees
Labels
area-testingbugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bugverification-neededVerification of issue is requestedVerification of issue is requestedverifiedVerification succeededVerification succeeded