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
With the latest version of the extension (2019.2.5416), there appears to be a set of "data science" tests under pythonFiles\tests that are causing a path conflict when we try to run our own integration "tests" using PyTest.
ImportError while loading conftest 'D:\git\vam\tests\integrationtests\conftest.py'.
tests\integrationtests\conftest.py:15: in <module>
from tests.utils.database_utils import (
E ModuleNotFoundError: No module named 'tests.utils'
If I add in an import tests statement before the failing import, and then set a breakpoint, I can see in the Variables/Locals panel that the tests module is actually loaded from C:\Users\Ian Claridge\.vscode\extensions\ms-python.python-2019.2.5416\pythonFiles\tests instead of D:\git\vam\tests. D:\git\vam is the working directory - the folder loaded in VSCode.
Environment data
VS Code version: 1.31.1
Extension version (available under the Extensions sidebar): 2019.2.5416
OS and version: Windows 10 Enterprise 1803 build 17134.590
Python version (& distribution if applicable, e.g. Anaconda): Python 3.6.6 (v3.6.6:4cf1f54eb7, Jun 27 2018, 03:37:03) [MSC v.1900 64 bit (AMD64)] on win32)
Type of virtual environment used venv
Relevant/affected Python packages and their versions: n/a
Comparison with a previous version of the extension shows that the pythonFiles\tests module is new, which is why this issue started appearing today.
Expected behaviour
My integration tests run.
Actual behaviour
I get a ModuleNotFoundError exception.
Steps to reproduce:
See above description.
Logs
$ cd "d:\git\vam" ; env "PYTHONPATH=." "PYTHONIOENCODING=UTF-8" "PYTHONUNBUFFERED=1" "d:\git\vam\venv\Scripts\python.exe" "c:\Users\Ian Claridge\.vscode\extensions\ms-python.python-2019.2.5416\pythonFiles\ptvsd_launcher.py" --default --client --host localhost --port 52340 -m pytest --html=integrationtests_windows/report.html tests/integrationtests
sys.path: ['D:\\git\\vam\\tests\\integrationtests', '', 'c:\\Users\\Ian Claridge\\.vscode\\extensions\\ms-python.python-2019.2.5416\\pythonFiles', 'D:\\git\\vam', 'D:\\git\\vam\\venv\\Scripts\\python36.zip', 'D:\\Tools\\Python36\\DLLs', 'D:\\Tools\\Python36\\lib', 'D:\\Tools\\Python36', 'D:\\git\\vam\\venv', 'D:\\git\\vam\\venv\\lib\\site-packages', 'D:\\git\\vam\\venv\\lib\\site-packages\\win32', 'D:\\git\\vam\\venv\\lib\\site-packages\\win32\\lib', 'D:\\git\\vam\\venv\\lib\\site-packages\\Pythonwin']
tests module: <module 'tests' from 'c:\\Users\\Ian Claridge\\.vscode\\extensions\\ms-python.python-2019.2.5416\\pythonFiles\\tests\\__init__.py'>
ImportError while loading conftest 'D:\git\vam\tests\integrationtests\conftest.py'.
tests\integrationtests\conftest.py:21: in <module>
from tests.utils.database_utils import (
E ModuleNotFoundError: No module named 'tests.utils'
The text was updated successfully, but these errors were encountered:
Hi Don. Yes, it does work when I delete (or rename) the tests directory from the extension. I guessed that would work, but deleting or renaming folders that belong to the extension does not seem ideal!
Is there a problem with the order of paths in sys.path? As you can see from the attached log output in the issue description, the c:\\Users\\Ian Claridge\\.vscode\\extensions\\ms-python.python-2019.2.5416\\pythonFiles path appears before my workspace path (D:\\git\\vam).
Thats, fine, its just a bug in our extension, just wanted to ensure it works before we re-publish another version.
Hang in there, we'll publish a new version with this fix.
With the latest version of the extension (2019.2.5416), there appears to be a set of "data science" tests under
pythonFiles\tests
that are causing a path conflict when we try to run our own integration "tests" using PyTest.Running the following VS Code launch config:
....results in the following error:
If I add in an
import tests
statement before the failing import, and then set a breakpoint, I can see in the Variables/Locals panel that thetests
module is actually loaded fromC:\Users\Ian Claridge\.vscode\extensions\ms-python.python-2019.2.5416\pythonFiles\tests
instead ofD:\git\vam\tests
.D:\git\vam
is the working directory - the folder loaded in VSCode.Environment data
Comparison with a previous version of the extension shows that the
pythonFiles\tests
module is new, which is why this issue started appearing today.Expected behaviour
My integration tests run.
Actual behaviour
I get a
ModuleNotFoundError
exception.Steps to reproduce:
Logs
The text was updated successfully, but these errors were encountered: