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
Discovered tests in workspace are run and their results displayed when doing CTRL+SHIFT+P: Test: Run All Tests.
Expect to run the command using the supplied path to the test folder.
Actual behaviour
Pytest fails to run, using the following command:
cwd: /work/repos/my_repo
Causing the error: ERROR - ModuleNotFoundError: No module named 'tests.integration_tests'
But it runs correctly when only running the tests in the tests folder and that can be achieved by clicking "Run All" on the "tests" subgroup:
This works without any issues, however this is not run when doing the VSCode Run All tests function and I have not been able to configure this working to command to be used.
Another way to get it working is ignoring the submodules in dependencies(they should be unit-tested using their own repos workflows) using --ignore-glob=dependencies/* in python.testing.pytestArgs. However I don't see why not manually ignoring submodules should break test(result) discovery.
So the first command fails while the two other commands work. I am not sure if it is intended for the first command to fail.
When using pytest from the terminal, all that's required to get it to run is a simple pytest.ini like this:
[pytest]
testpaths =
tests
and the simply doing pytest with the repo as cwd, no ignoring the dependencies folder required.
Steps to reproduce:
Replicate above repo structure with Pytest files in /tests and in /tests/integration_tests and include another repo as a submodule that also contains its own tests.
The text was updated successfully, but these errors were encountered:
Environment data
Version: 1.61.2
Commit: 6cba118ac49a1b88332f312a8f67186f7f3c1643
Date: 2021-10-19T14:58:13.605Z
Electron: 13.5.1
Chrome: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Linux x64 5.4.0-90-generic snap
python.languageServer
setting: PylanceExpected behaviour
Given the following repo structure:
Discovered tests in workspace are run and their results displayed when doing
CTRL+SHIFT+P: Test: Run All Tests
.Expect to run the command using the supplied path to the test folder.
Actual behaviour
Pytest fails to run, using the following command:
Causing the error:
ERROR - ModuleNotFoundError: No module named 'tests.integration_tests'
But it runs correctly when only running the tests in the tests folder and that can be achieved by clicking "Run All" on the "tests" subgroup:
This works without any issues, however this is not run when doing the VSCode Run All tests function and I have not been able to configure this working to command to be used.
Another way to get it working is ignoring the submodules in dependencies(they should be unit-tested using their own repos workflows) using
--ignore-glob=dependencies/*
inpython.testing.pytestArgs
. However I don't see why not manually ignoring submodules should break test(result) discovery.So the first command fails while the two other commands work. I am not sure if it is intended for the first command to fail.
When using pytest from the terminal, all that's required to get it to run is a simple
pytest.ini
like this:and the simply doing
pytest
with the repo as cwd, no ignoring the dependencies folder required.Steps to reproduce:
Replicate above repo structure with Pytest files in /tests and in /tests/integration_tests and include another repo as a submodule that also contains its own tests.
The text was updated successfully, but these errors were encountered: