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
Expected: Pytest should be able to discover tests on the devcontainer
Actual: Python extension throws an error trying to read a tempfile it created, and no tests are discovered.
Steps to reproduce:
I'm not certain how to build a minimum reproduction case here—this is a Django project running in a devcontainer. I can run pytest just fine inside the container, and the exception is thrown inside python extension code.
Diagnostic data
Python version (& distribution if applicable, e.g. Anaconda): 3.11.8
Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Global
Value of the python.languageServer setting: Default
Output for Python in the Output panel (View→Output, change the drop-down the upper-right of the Output panel to Python)
2024-02-21 15:25:12.197 [error] Error discovering pytest tests:
n [Error]: Traceback (most recent call last):
File "/home/eb/.vscode-server/extensions/ms-python.python-2024.0.1/pythonFiles/testing_tools/run_adapter.py", line 22, in <module>
main(tool, cmd, subargs, toolargs)
File "/home/eb/.vscode-server/extensions/ms-python.python-2024.0.1/pythonFiles/testing_tools/adapter/__main__.py", line 99, in main
parents, result = run(toolargs, **subargs)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/eb/.vscode-server/extensions/ms-python.python-2024.0.1/pythonFiles/testing_tools/adapter/pytest/_discovery.py", line 29, in discover
with util.hide_stdio() if hidestdio else util.noop_cm() as stdio:
File "/usr/local/lib/python3.11/contextlib.py", line 144, in __exit__
next(self.gen)
File "/home/eb/.vscode-server/extensions/ms-python.python-2024.0.1/pythonFiles/testing_tools/adapter/util.py", line 251, in hide_stdio
with _temp_io() as (sio, fileobj):
File "/usr/local/lib/python3.11/contextlib.py", line 144, in __exit__
next(self.gen)
File "/home/eb/.vscode-server/extensions/ms-python.python-2024.0.1/pythonFiles/testing_tools/adapter/util.py", line 244, in _temp_io
buff = tmp.read()
^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory
Extension version: 2024.0.1
VS Code version: Code 1.86.2 (903b1e9d8990623e3d7da1df3d33db3e42d80eda, 2024-02-13T19:42:12.210Z)
OS version: Darwin arm64 23.1.0
Modes:
Remote OS version: Linux arm64 6.6.12-linuxkit
Hello! It looks like you are on the old version of testing due to the path referenced -2024.0.1/pythonFiles/testing_tools/adapter/pytest/_discovery.py". Can you see if in your user settings you have disabled python experiments? You can also add "python.experiments.optInto": [
"pythonTestAdapter"
],
if you do this an reload, then you should see a different path / set of logs. See if that works, if not then please send me to logs from that run.
Type: Bug
Behaviour
Expected vs. Actual
Expected: Pytest should be able to discover tests on the devcontainer
Actual: Python extension throws an error trying to read a tempfile it created, and no tests are discovered.
Steps to reproduce:
I'm not certain how to build a minimum reproduction case here—this is a Django project running in a devcontainer. I can run pytest just fine inside the container, and the exception is thrown inside python extension code.
Diagnostic data
python.languageServer
setting: DefaultOutput for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)User Settings
Extension version: 2024.0.1
VS Code version: Code 1.86.2 (903b1e9d8990623e3d7da1df3d33db3e42d80eda, 2024-02-13T19:42:12.210Z)
OS version: Darwin arm64 23.1.0
Modes:
Remote OS version: Linux arm64 6.6.12-linuxkit
System Info
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
A/B Experiments
The text was updated successfully, but these errors were encountered: