Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pixi errror when loading pytest in VS code #23773

Closed
adam-lagoda opened this issue Jul 9, 2024 · 31 comments
Closed

Pixi errror when loading pytest in VS code #23773

adam-lagoda opened this issue Jul 9, 2024 · 31 comments
Assignees
Labels
info-needed Issue requires more information from poster triage-needed Needs assignment to the proper sub-team

Comments

@adam-lagoda
Copy link

Type: Bug

Behaviour

I get a pytest discovery error when starting pytest from the vs code testing window. The systems utilizes micromamba as the python package manager, with an alias set up between conda -> micromamba. The error originates from pixi not being found,

Steps to reproduce:

  1. Use micromamba environment that is activated in powershell
  2. Open VSCode and the testing toolbar (with the Python Extension set to 2024.10.0)
  3. Tests will not be discovered

Diagnostic data

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

XXX

Extension version: 2024.10.0
VS Code version: Code 1.91.0 (ea1445cc7016315d0f5728f8e8b12a45dc0a7286, 2024-07-01T18:52:22.949Z)
OS version: Windows_NT x64 10.0.19045
Modes:
Remote OS version: Linux x64 5.15.153.1-microsoft-standard-WSL2

  • Python version (& distribution if applicable, e.g. Anaconda): 3.11.9
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Micromamba
  • Value of the python.languageServer setting: Default
User Settings


condaPath: "<placeholder>"

languageServer: "Pylance"

testing
• pytestArgs: "<placeholder>"
• pytestEnabled: true

Installed Extensions
Extension Name Extension Id Version
autoDocstring - Python Docstring Generator njpwerner.autodocstring 0.6.1
CodeSnap adpyke.codesnap 1.3.4
CSV to Table phplasma.csv-to-table 1.4.0
Data Wrangler ms-toolsai.datawrangler 1.4.1
FindItFaster TomRijndorp.find-it-faster 0.0.38
Git Graph mhutchie.git-graph 1.30.0
GitLens — Git supercharged eamodio.gitlens 15.1.0
Hex Editor ms-vscode.hexeditor 1.10.0
JavaScript Debugger ms-vscode.js-debug 1.91.0
json ZainChen.json 2.0.2
Jupyter ms-toolsai.jupyter 2024.6.0
Jupyter Cell Tags ms-toolsai.vscode-jupyter-cell-tags 0.1.9
Jupyter Notebook Renderers ms-toolsai.jupyter-renderers 1.0.18
Jupyter Slide Show ms-toolsai.vscode-jupyter-slideshow 0.1.6
Live Preview ms-vscode.live-server 0.4.13
Path Intellisense christian-kohler.path-intellisense 2.9.0
Pretty Formatter mblode.pretty-formatter 0.2.4
Pylance ms-python.vscode-pylance 2024.6.1
Python ms-python.python 2024.11.2024070801
Python Debugger ms-python.debugpy 2024.6.0
Rainbow CSV mechatroner.rainbow-csv 3.12.0
SQLite alexcvzz.vscode-sqlite 0.14.1
SVG jock.svg 1.5.4
Table Visualizer for JavaScript Profiles ms-vscode.vscode-js-profile-table 1.0.9
Todo Tree Gruntfuggly.todo-tree 0.0.226
System Info
Item Value
CPUs 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz (8 x 2995)
GPU Status 2d_canvas: enabled
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
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) undefined
Memory (System) 23.71GB (5.42GB free)
Process Argv --folder-uri=vscode-remote://wsl+Ubuntu-22.04/home/adam/Documents/Git/QUIET --remote=wsl+Ubuntu-22.04
Screen Reader no
VM 0%
Item Value
Remote WSL: Ubuntu-22.04
OS Linux x64 5.15.153.1-microsoft-standard-WSL2
CPUs 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz (8 x 0)
Memory (System) 11.54GB (9.78GB free)
VM 0%
@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Jul 9, 2024
@adam-lagoda
Copy link
Author

image

@rafrafek
Copy link

rafrafek commented Jul 9, 2024

I have the same issue that started occurring after the latest VS Code Python extension update. I use Poetry to create my virtual environments, and I don't even know what Pixi is.

I'm getting a "pytest Discovery Error" and am unable to launch any tests in VS Code.

@adam-lagoda
Copy link
Author

I have tested that downgrading to v2024.8.1 works @rafrafek. However this is a temporary solution, and I would highly appreciate fixing the bug by the core team

@rafrafek
Copy link

rafrafek commented Jul 9, 2024

My logs:

2024-07-09 14:41:13.122 [info] Experiment 'pythonCreateEnvOnPipInstall' is active
2024-07-09 14:41:13.122 [info] Experiment 'pythonRecommendTensorboardExt' is active
2024-07-09 14:41:13.122 [info] Experiment 'pythonTerminalEnvVarActivation' is active
2024-07-09 14:41:13.122 [info] Experiment 'pythonTestAdapter' is active
2024-07-09 14:41:13.122 [error] Reading directory to watch failed [Error: ENOENT: no such file or directory, scandir '/Users/username/Projects/project-name/.pixi/envs'
	at Object.readdirSync (node:fs:1515:3)
	at t.readdirSync (node:electron/js2c/node_init:2:11289)
	at /Users/username/.vscode/extensions/ms-python.python-2024.10.0-darwin-arm64/out/client/extension.js:2:574598
	at /Users/username/.vscode/extensions/ms-python.python-2024.10.0-darwin-arm64/out/client/extension.js:2:574789
	at Array.map (<anonymous>)
	at d.initWatchers (/Users/username/.vscode/extensions/ms-python.python-2024.10.0-darwin-arm64/out/client/extension.js:2:574507)
	at async d.ensureWatchersReady (/Users/username/.vscode/extensions/ms-python.python-2024.10.0-darwin-arm64/out/client/extension.js:2:536827)] {
  errno: -2,
  syscall: 'scandir',
  code: 'ENOENT',
  path: '/Users/username/Projects/project-name/.pixi/envs'
}
2024-07-09 14:41:13.122 [error] Dir "/Users/username/Projects/project-name/.pixi/envs" is not watchable (directory does not exist)
2024-07-09 14:41:13.154 [info] Default formatter is set to null for workspace /Users/username/Projects/project-name
2024-07-09 14:41:13.157 [info] Python interpreter path: ./.venv/bin/python
2024-07-09 14:41:13.282 [info] > pyenv which python
2024-07-09 14:41:13.282 [info] cwd: .
2024-07-09 14:41:13.915 [info] > pixi --version
2024-07-09 14:41:13.916 [error] [Error: spawn pixi ENOENT
	at ChildProcess._handle.onexit (node:internal/child_process:286:19)
	at onErrorNT (node:internal/child_process:484:16)
	at process.processTicksAndRejections (node:internal/process/task_queues:82:21)] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn pixi',
  path: 'pixi',
  spawnargs: [ '--version' ]
}
2024-07-09 14:41:13.916 [warning] could not find a pixi interpreter for the interpreter at /Users/username/Projects/project-name/.venv/bin/python
2024-07-09 14:41:14.487 [warning] could not find a pixi interpreter for the interpreter at /Users/username/Projects/project-name/.venv/bin/python
2024-07-09 14:41:14.497 [info] > . ./.venv/bin/activate && echo 'e8b39361-0157-4923-80e1-22d70d46dee6' && python ~/.vscode/extensions/ms-python.python-2024.10.0-darwin-arm64/python_files/printEnvVariables.py
2024-07-09 14:41:14.497 [info] shell: bash
2024-07-09 14:41:14.527 [warning] could not find a pixi interpreter for the interpreter at /Users/username/Projects/project-name/.venv/bin/python
2024-07-09 14:41:14.528 [info] > ./.venv/bin/python -m pytest -p vscode_pytest --collect-only tests
2024-07-09 14:41:14.528 [info] cwd: .
2024-07-09 14:41:14.657 [error] Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/pytest/__main__.py", line 5, in <module>
    raise SystemExit(pytest.console_main())
                     ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py", line 192, in console_main
    code = main()
           ^^^^^^
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py", line 150, in main
    
2024-07-09 14:41:14.658 [error] config = _prepareconfig(args, plugins)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py", line 331, in _prepareconfig
    config = pluginmanager.hook.pytest_cmdline_parse(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/pluggy/_hooks.py", line 265, in __call__
    return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/pluggy/_manager.py", line 80, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/pluggy/_callers.py", line 55, in _multicall
    gen.send(outcome)
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/_pytest/helpconfig.py", line 104, in pytest_cmdline_parse
    config: Config = outcome.get_result()
                     ^^^^^^^^^^^^^^^^^^^^
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/pluggy/_result.py", line 60, in get_result
    raise ex[1].with_traceback(ex[2])

2024-07-09 14:41:14.658 [error]   File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/pluggy/_callers.py", line 39, in _multicall
    res = hook_impl.function(*args)
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py", line 1075, in pytest_cmdline_parse

2024-07-09 14:41:14.658 [error]     self.parse(args)
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py", line 1425, in parse
    self._preparse(args, addopts=addopts)
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py", line 1301, in _preparse

2024-07-09 14:41:14.659 [error]     self.pluginmanager.consider_preparse(args, exclude_only=False)
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py", line 709, in consider_preparse

2024-07-09 14:41:14.659 [error]     self.consider_pluginarg(parg)
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py", line 735, in consider_pluginarg

2024-07-09 14:41:14.659 [error]     self.import_plugin(arg, consider_entry_points=True)
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py", line 781, in import_plugin

2024-07-09 14:41:14.659 [error]     __import__(importspec)

2024-07-09 14:41:14.659 [error]   File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/_pytest/assertion/rewrite.py", line 186, in exec_module
    exec(co, module.__dict__)
  File "/Users/username/.vscode/extensions/ms-python.python-2024.10.0-darwin-arm64/python_files/vscode_pytest/__init__.py", line 895, in <module>
    class DeferPlugin:
  File "/Users/username/.vscode/extensions/ms-python.python-2024.10.0-darwin-arm64/python_files/vscode_pytest/__init__.py", line 896, in DeferPlugin
    @pytest.hookimpl(wrapper=True)
     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: HookimplMarker.__call__() got an unexpected keyword argument 'wrapper'

2024-07-09 14:41:14.676 [error] Subprocess exited unsuccessfully with exit code 1 and signal null on workspace /Users/username/Projects/project-name.
2024-07-09 14:41:14.677 [error] Subprocess exited unsuccessfully with exit code 1 and signal null on workspace /Users/username/Projects/project-name. Creating and sending error discovery payload
2024-07-09 14:41:14.677 [error] pytest test discovery error for workspace:  /Users/username/Projects/project-name 
  
 The python test process was terminated before it could exit on its own, the process errored with: Code: 1, Signal: null for workspace /Users/username/Projects/project-name

@eleanorjboyd
Copy link
Member

Hi! What version of pytest are you using? It might be due to you being on a older version and updating might fix your problem.

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Jul 9, 2024
@rafrafek
Copy link

rafrafek commented Jul 9, 2024

Hi! I'm using version 7.4.4, and updating to the latest version 8.2.2 fixed the issue in my case. I'm not the author of this issue, though, so I would wait to confirm if it helps in that case.

@paulf81
Copy link

paulf81 commented Jul 10, 2024

I have also had this issue

@jk1man1
Copy link

jk1man1 commented Jul 10, 2024

I had the same problem. It seems that having the pytest verion 7.4.4, and updating to the latest version 8.2.2, fixed the issue on my end

@adam-lagoda
Copy link
Author

I have now checked my environment package versions, and I had pytest running also running on 7.4.4, however, as @jk1man1 and @rafrafek pointed out, 8.2.2 works out of the box. I have also tested, and 7.4.0 works as well.
I am therefore closing this issue, as not relevant for vscode-python

@adam-lagoda adam-lagoda closed this as not planned Won't fix, can't repro, duplicate, stale Jul 10, 2024
@github-actions github-actions bot removed the info-needed Issue requires more information from poster label Jul 10, 2024
@Ivanli-RT
Copy link

My logs:

2024-07-09 14:41:13.122 [info] Experiment 'pythonCreateEnvOnPipInstall' is active
2024-07-09 14:41:13.122 [info] Experiment 'pythonRecommendTensorboardExt' is active
2024-07-09 14:41:13.122 [info] Experiment 'pythonTerminalEnvVarActivation' is active
2024-07-09 14:41:13.122 [info] Experiment 'pythonTestAdapter' is active
2024-07-09 14:41:13.122 [error] Reading directory to watch failed [Error: ENOENT: no such file or directory, scandir '/Users/username/Projects/project-name/.pixi/envs'
	at Object.readdirSync (node:fs:1515:3)
	at t.readdirSync (node:electron/js2c/node_init:2:11289)
	at /Users/username/.vscode/extensions/ms-python.python-2024.10.0-darwin-arm64/out/client/extension.js:2:574598
	at /Users/username/.vscode/extensions/ms-python.python-2024.10.0-darwin-arm64/out/client/extension.js:2:574789
	at Array.map (<anonymous>)
	at d.initWatchers (/Users/username/.vscode/extensions/ms-python.python-2024.10.0-darwin-arm64/out/client/extension.js:2:574507)
	at async d.ensureWatchersReady (/Users/username/.vscode/extensions/ms-python.python-2024.10.0-darwin-arm64/out/client/extension.js:2:536827)] {
  errno: -2,
  syscall: 'scandir',
  code: 'ENOENT',
  path: '/Users/username/Projects/project-name/.pixi/envs'
}
2024-07-09 14:41:13.122 [error] Dir "/Users/username/Projects/project-name/.pixi/envs" is not watchable (directory does not exist)
2024-07-09 14:41:13.154 [info] Default formatter is set to null for workspace /Users/username/Projects/project-name
2024-07-09 14:41:13.157 [info] Python interpreter path: ./.venv/bin/python
2024-07-09 14:41:13.282 [info] > pyenv which python
2024-07-09 14:41:13.282 [info] cwd: .
2024-07-09 14:41:13.915 [info] > pixi --version
2024-07-09 14:41:13.916 [error] [Error: spawn pixi ENOENT
	at ChildProcess._handle.onexit (node:internal/child_process:286:19)
	at onErrorNT (node:internal/child_process:484:16)
	at process.processTicksAndRejections (node:internal/process/task_queues:82:21)] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn pixi',
  path: 'pixi',
  spawnargs: [ '--version' ]
}
2024-07-09 14:41:13.916 [warning] could not find a pixi interpreter for the interpreter at /Users/username/Projects/project-name/.venv/bin/python
2024-07-09 14:41:14.487 [warning] could not find a pixi interpreter for the interpreter at /Users/username/Projects/project-name/.venv/bin/python
2024-07-09 14:41:14.497 [info] > . ./.venv/bin/activate && echo 'e8b39361-0157-4923-80e1-22d70d46dee6' && python ~/.vscode/extensions/ms-python.python-2024.10.0-darwin-arm64/python_files/printEnvVariables.py
2024-07-09 14:41:14.497 [info] shell: bash
2024-07-09 14:41:14.527 [warning] could not find a pixi interpreter for the interpreter at /Users/username/Projects/project-name/.venv/bin/python
2024-07-09 14:41:14.528 [info] > ./.venv/bin/python -m pytest -p vscode_pytest --collect-only tests
2024-07-09 14:41:14.528 [info] cwd: .
2024-07-09 14:41:14.657 [error] Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/pytest/__main__.py", line 5, in <module>
    raise SystemExit(pytest.console_main())
                     ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py", line 192, in console_main
    code = main()
           ^^^^^^
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py", line 150, in main
    
2024-07-09 14:41:14.658 [error] config = _prepareconfig(args, plugins)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py", line 331, in _prepareconfig
    config = pluginmanager.hook.pytest_cmdline_parse(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/pluggy/_hooks.py", line 265, in __call__
    return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/pluggy/_manager.py", line 80, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/pluggy/_callers.py", line 55, in _multicall
    gen.send(outcome)
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/_pytest/helpconfig.py", line 104, in pytest_cmdline_parse
    config: Config = outcome.get_result()
                     ^^^^^^^^^^^^^^^^^^^^
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/pluggy/_result.py", line 60, in get_result
    raise ex[1].with_traceback(ex[2])

2024-07-09 14:41:14.658 [error]   File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/pluggy/_callers.py", line 39, in _multicall
    res = hook_impl.function(*args)
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py", line 1075, in pytest_cmdline_parse

2024-07-09 14:41:14.658 [error]     self.parse(args)
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py", line 1425, in parse
    self._preparse(args, addopts=addopts)
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py", line 1301, in _preparse

2024-07-09 14:41:14.659 [error]     self.pluginmanager.consider_preparse(args, exclude_only=False)
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py", line 709, in consider_preparse

2024-07-09 14:41:14.659 [error]     self.consider_pluginarg(parg)
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py", line 735, in consider_pluginarg

2024-07-09 14:41:14.659 [error]     self.import_plugin(arg, consider_entry_points=True)
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py", line 781, in import_plugin

2024-07-09 14:41:14.659 [error]     __import__(importspec)

2024-07-09 14:41:14.659 [error]   File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "/Users/username/Projects/project-name/.venv/lib/python3.12/site-packages/_pytest/assertion/rewrite.py", line 186, in exec_module
    exec(co, module.__dict__)
  File "/Users/username/.vscode/extensions/ms-python.python-2024.10.0-darwin-arm64/python_files/vscode_pytest/__init__.py", line 895, in <module>
    class DeferPlugin:
  File "/Users/username/.vscode/extensions/ms-python.python-2024.10.0-darwin-arm64/python_files/vscode_pytest/__init__.py", line 896, in DeferPlugin
    @pytest.hookimpl(wrapper=True)
     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: HookimplMarker.__call__() got an unexpected keyword argument 'wrapper'

2024-07-09 14:41:14.676 [error] Subprocess exited unsuccessfully with exit code 1 and signal null on workspace /Users/username/Projects/project-name.
2024-07-09 14:41:14.677 [error] Subprocess exited unsuccessfully with exit code 1 and signal null on workspace /Users/username/Projects/project-name. Creating and sending error discovery payload
2024-07-09 14:41:14.677 [error] pytest test discovery error for workspace:  /Users/username/Projects/project-name 
  
 The python test process was terminated before it could exit on its own, the process errored with: Code: 1, Signal: null for workspace /Users/username/Projects/project-name

my error log is all the same

@eleanorjboyd
Copy link
Member

Hi, seems like this is actually this error: #23707 and therefore a duplicate. I am putting in a fix hopefully today for it. Lmk if you aren't seeing this error and are seeing something else and I can reopen thank you!

@rafrafek
Copy link

rafrafek commented Jul 10, 2024

If someone wants to stay on Pytest version 7.x, can just bump pluggy https://pypi.org/project/pluggy/ to version 1.5.0.

#23707 (comment)

@garganpaull
Copy link

Ive got the same problem which started today. Am using Python 3.10.6, pytest-8.2.2, pluggy-1.5.0.

[warning] could not find a pixi interpreter for the interpreter at c:\venv\Scripts\python.exe
...
File "c:\venv\lib\site-packages\pluggy_manager.py", line 211, in unregister
assert name is not None, "plugin is not registered"
AssertionError: plugin is not registered

The python test process was terminated before it could exit on its own, the process errored with: Code: 1, Signal: null for workspace

@eleanorjboyd
Copy link
Member

@garganpaull are you trying to use pixi?

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Jul 11, 2024
@garganpaull
Copy link

garganpaull commented Jul 11, 2024

@garganpaull are you trying to use pixi?

No. I dont even know what Pixi is.

My colleague does not have this issue and is running Pytest version is 7.2.0, Python version is 3.10.2 using VS Code v1.86.2.

Im using VS Code 1.91.1, Python 3.10.6, pytest-8.2.2, pluggy-1.5.0.

This issue only started for me yesterday when I upgraded my VS Code

@github-actions github-actions bot removed the info-needed Issue requires more information from poster label Jul 11, 2024
@loomanss
Copy link

loomanss commented Jul 12, 2024

my steps to a solution:

  • poetry update pytest
  • removed .venv folder
  • updated python version from 3.10 to 3.11 in pyrpoject.toml
  • removed poetry.lock
  • poetry env use 3.11
  • poetry install

ended up with
pytest 8.2.2
pluggy 1.5.0

@jepManalo
Copy link

jepManalo commented Jul 12, 2024

I am actually also encountering this pixi error on my VS Code after the update. Right now, pytest Discovery is displaying errors that I have never seen before.

My current Versions are:
pytest 7.2.2
pytest bdd 7.1.2
pluggy 1.0.0
VSCode 1.91.1
python 3.8.10

Here is the complete error:

`2024-07-12 15:09:10.914 [info] Experiment 'pythonaacf' is active
2024-07-12 15:09:10.915 [info] Experiment 'pythonCreateEnvOnPipInstall' is active
2024-07-12 15:09:10.915 [info] Experiment 'pythonRecommendTensorboardExt' is active
2024-07-12 15:09:10.915 [info] Experiment 'pythonTerminalEnvVarActivation' is active
2024-07-12 15:09:10.915 [info] Experiment 'pythonTestAdapter' is active
2024-07-12 15:09:10.915 [error] Reading directory to watch failed [Error: ENOENT: no such file or directory, scandir 'c:<project_name>.pixi\envs'
at Object.readdirSync (node:fs:1515:3)
at t.readdirSync (node:electron/js2c/node_init:2:11289)
at c:\Users<username>.vscode\extensions\ms-python.python-2024.10.0-win32-x64\out\client\extension.js:2:574598
at c:\Users<username>.vscode\extensions\ms-python.python-2024.10.0-win32-x64\out\client\extension.js:2:574789
at Array.map ()
at d.initWatchers (c:\Users<username>.vscode\extensions\ms-python.python-2024.10.0-win32-x64\out\client\extension.js:2:574507)
at async d.ensureWatchersReady (c:\Users<username>.vscode\extensions\ms-python.python-2024.10.0-win32-x64\out\client\extension.js:2:536827)] {
errno: -4058,
syscall: 'scandir',
code: 'ENOENT',
path: 'c:\<project_name>\.pixi\envs'
}
2024-07-12 15:09:10.915 [error] Dir "c:<project_name>.pixi\envs" is not watchable (directory does not exist)
2024-07-12 15:09:10.915 [info] Default formatter is set to null for workspace c:<project_name>
2024-07-12 15:09:10.958 [info] Python interpreter path: ..venv\Scripts\python.exe
2024-07-12 15:09:11.763 [info] > pyenv which python
2024-07-12 15:09:11.763 [info] cwd: .
2024-07-12 15:09:11.848 [info] > conda info --json
2024-07-12 15:09:12.491 [info] > pixi --version
2024-07-12 15:09:12.511 [error] [Error: spawn pixi ENOENT
at ChildProcess._handle.onexit (node:internal/child_process:286:19)
at onErrorNT (node:internal/child_process:484:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)] {
errno: -4058,
code: 'ENOENT',
syscall: 'spawn pixi',
path: 'pixi',
spawnargs: [ '--version' ]
}
2024-07-12 15:09:12.512 [warning] could not find a pixi interpreter for the interpreter at c:<project_name>.venv\Scripts\python.exe
2024-07-12 15:09:12.803 [info] > & ./.venv/Scripts/Activate.ps1 ; echo 'e8b39361-0157-4923-80e1-22d70d46dee6' ; python ~/.vscode/extensions/ms-python.python-2024.10.0-win32-x64/python_files/printEnvVariables.py
2024-07-12 15:09:12.803 [info] shell: powershell
2024-07-12 15:09:14.207 [info] Discover tests for workspace name: <project_name> - uri: c:<project_name>
2024-07-12 15:09:14.207 [info] Running discovery for pytest using the new test adapter.
2024-07-12 15:09:14.231 [warning] The cwd resolves to a different path, checking if it has a symbolic link somewhere in its path.
2024-07-12 15:09:14.233 [warning] could not find a pixi interpreter for the interpreter at c:<project_name>.venv\Scripts\python.exe
2024-07-12 15:09:14.562 [info] > ./.venv/Scripts/activate.bat && echo 'e8b39361-0157-4923-80e1-22d70d46dee6' && python ~/.vscode/extensions/ms-python.python-2024.10.0-win32-x64/python_files/printEnvVariables.py
2024-07-12 15:09:14.562 [info] shell: commandPrompt
2024-07-12 15:09:14.841 [info] > C:\ProgramData\anaconda3\Scripts\conda.exe info --json
2024-07-12 15:09:15.309 [info] > ~\AppData\Local\Programs\Python\Python38\python.exe ~/.vscode/extensions/ms-python.python-2024.10.0-win32-x64/python_files/printEnvVariables.py
2024-07-12 15:09:15.309 [info] shell: powershell
2024-07-12 15:09:15.312 [warning] could not find a pixi interpreter for the interpreter at c:<project_name>.venv\Scripts\python.exe
2024-07-12 15:09:15.335 [info] > ..venv\Scripts\python.exe -m pytest -p vscode_pytest --collect-only .
2024-07-12 15:09:15.335 [info] cwd: .
2024-07-12 15:09:15.417 [info] Starting Pylance language server.
2024-07-12 15:09:16.116 [info] Prepending environment variable PATH in collection with c:\Users<username>.vscode\extensions\ms-python.python-2024.10.0-win32-x64\python_files\deactivate\powershell;C:<project_name>.venv\Scripts; {"applyAtShellIntegration":true,"applyAtProcessCreation":true}
2024-07-12 15:09:16.116 [info] Setting environment variable VIRTUAL_ENV in collection to C:<project_name>.venv {"applyAtShellIntegration":true,"applyAtProcessCreation":true}
2024-07-12 15:09:16.909 [error] Traceback (most recent call last):
File "C:\Users<username>\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 194, in run_module_as_main
return run_code(code, main_globals, None,
File "C:\Users<username>\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "c:<project_name>.venv\lib\site-packages\pytest_main
.py", line 5, in
raise SystemExit(pytest.console_main())
File "c:<project_name>.venv\lib\site-packages_pytest\config_init
.py", line 189, in console_main
code = main()
File "c:<project_name>.venv\lib\site-packages_pytest\config_init
.py", line 147, in main
config = prepareconfig(args, plugins)
File "c:<project_name>.venv\lib\site-packages_pytest\config_init
.py", line 328, in _prepareconfig
config = pluginmanager.hook.pytest_cmdline_parse(
File "c:<project_name>.venv\lib\site-packages\pluggy_hooks.py", line 265, in call
return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
File "c:<project_name>.venv\lib\site-packages\pluggy_manager.py", line 80, in hookexec
return self.inner_hookexec(hook_name, methods, kwargs, firstresult)
File "c:<project_name>.venv\lib\site-packages\pluggy_callers.py", line 55, in multicall
gen.send(outcome)
File "c:<project_name>.venv\lib\site-packages_pytest\helpconfig.py", line 103, in pytest_cmdline_parse
config: Config = outcome.get_result()
File "c:<project_name>.venv\lib\site-packages\pluggy_result.py", line 60, in get_result
raise ex[1].with_traceback(ex[2])
File "c:<project_name>.venv\lib\site-packages\pluggy_callers.py", line 39, in multicall
res = hook_impl.function(*args)
File "c:<project_name>.venv\lib\site-packages_pytest\config_init
.py", line 1075, in pytest_cmdline_parse
self.parse(args)
File "c:<project_name>.venv\lib\site-packages_pytest\config_init
.py", line 1425, in parse
self.preparse(args, addopts=addopts)
File "c:<project_name>.venv\lib\site-packages_pytest\config_init
.py", line 1301, in preparse
self.pluginmanager.consider_preparse(args, exclude_only=False)
File "c:<project_name>.venv\lib\site-packages_pytest\config_init
.py", line 710, in consider_preparse
self.consider_pluginarg(parg)
File "c:<project_name>.venv\lib\site-packages_pytest\config_init
.py", line 736, in consider_pluginarg
self.import_plugin(arg, consider_entry_points=True)
File "c:<project_name>.venv\lib\site-packages_pytest\config_init
.py", line 782, in import_plugin
import(importspec)
File "", line 991, in _find_and_load
File "", line 975, in find_and_load_unlocked
File "", line 671, in load_unlocked
File "c:<project_name>.venv\lib\site-packages_pytest\assertion\rewrite.py", line 178, in exec_module
exec(co, module.dict)
File "c:\Users<username>.vscode\extensions\ms-python.python-2024.10.0-win32-x64\python_files\vscode_pytest_init
.py", line 895, in
class DeferPlugin:
File "c:\Users<username>.vscode\extensions\ms-python.python-2024.10.0-win32-x64\python_files\vscode_pytest_init
.py", line 896, in DeferPlugin
@pytest.hookimpl(wrapper=True)
TypeError: call() got an unexpected keyword argument 'wrapper'

2024-07-12 15:09:16.987 [error] Subprocess exited unsuccessfully with exit code 1 and signal null on workspace c:<project_name>.
2024-07-12 15:09:16.987 [error] Subprocess exited unsuccessfully with exit code 1 and signal null on workspace c:<project_name>. Creating and sending error discovery payload
2024-07-12 15:09:16.987 [error] pytest test discovery error for workspace: c:<project_name>

The python test process was terminated before it could exit on its own, the process errored with: Code: 1, Signal: null for workspace c:<project_name>
`

@zljubisic
Copy link

I can report the same problem. In my output log I can find:
2024-07-16 12:15:12.324 [error] Reading directory to watch failed [Error: ENOENT: no such file or directory, scandir '/home/path_to_the_project/.pixi/envs'

Apart from it, I can also find this in my output log:

2024-07-16 12:18:22.351 [info] INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/local/miniconda3/envs/<project_name>/lib/python3.11/site-packages/_pytest/main.py", line 271, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0

2024-07-16 12:18:22.351 [info] INTERNALERROR>                          ^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/local/miniconda3/envs/<project_name>/lib/python3.11/site-packages/_pytest/main.py", line 324, in _main
INTERNALERROR>     config.hook.pytest_collection(session=session)
INTERNALERROR>   File "/local/miniconda3/envs/<project_name>/lib/python3.11/site-packages/pluggy/_hooks.py", line 501, in __call__
INTERNALERROR>     return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
INTERNALERROR>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/local/miniconda3/envs/<project_name>/lib/python3.11/site-packages/pluggy/_manager.py", line 119, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/local/miniconda3/envs/<project_name>/lib/python3.11/site-packages/pluggy/_callers.py", line 181, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>            ^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/local/miniconda3/envs/<project_name>/lib/python3.11/site-packages/pluggy/_result.py", line 99, in get_result
INTERNALERROR>     raise exc.with_traceback(exc.__traceback__)
INTERNALERROR>   File "/local/miniconda3/envs/<project_name>/lib/python3.11/site-packages/pluggy/_callers.py", line 102, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>           ^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/local/miniconda3/envs/<project_name>/lib/python3.11/site-packages/_pytest/main.py", line 335, in pytest_collection
INTERNALERROR>     session.perform_collect()
INTERNALERROR>   File "/local/miniconda3/envs/<project_name>/lib/python3.11/site-packages/_pytest/main.py", line 677, in perform_collect
INTERNALERROR>     self.config.pluginmanager.check_pending()
INTERNALERROR>   File "/local/miniconda3/envs/<project_name>/lib/python3.11/site-packages/pluggy/_manager.py", line 384, in check_pending
INTERNALERROR>     raise PluginValidationError(
INTERNALERROR> pluggy._manager.PluginValidationError: unknown hook 'pytest_xdist_auto_num_workers' in plugin <vscode_pytest.DeferPlugin object at 0x7f1936d327d0>

I don't know if it is related to pixi.

@garganpaull
Copy link

@garganpaull are you trying to use pixi?

No. I dont even know what Pixi is.

My colleague does not have this issue and is running Pytest version is 7.2.0, Python version is 3.10.2 using VS Code v1.86.2.

Im using VS Code 1.91.1, Python 3.10.6, pytest-8.2.2, pluggy-1.5.0.

This issue only started for me yesterday when I upgraded my VS Code

Is this fixed yet as problem still persists.

@rafrafek
Copy link

I'm using VS Code 1.91.1, Python 3.10.6, pytest-8.2.2, pluggy-1.5.0.

Can you try with Python 3.10.14? Python 3.10.6 is 2 years old and there were many fixes between 3.10.6 and 3.10.14.

@toddsayersshell
Copy link

Also having this issue. I have no idea about or intention to use Pixi.

@toddsayersshell
Copy link

Dir "/workspaces/EARL-CAPEX-API/.pixi/envs" is not watchable (directory does not exist)

This is untrue; I explicitly created that path... and yet the error persists.

pluggy 1.5.0
pytest 8.2.2
pytest-cov 5.0.0
Python 3.9.2 (required by my project)

Linux e0655aa2f2f5 5.15.0-117-generic #127-Ubuntu SMP Fri Jul 5 20:13:28 UTC 2024 x86_64 GNU/Linux

@clement-chaneching
Copy link

clement-chaneching commented Aug 7, 2024

Hello,

I am also having the same error but I am willing to use pixi:

 The python test process was terminated before it could exit on its own, the process errored with: Code: 1, Signal: null for workspace /HOME/path/testclement/forecasting/forecasting
2024-08-07 15:35:42.896 [warning] could not find a pixi interpreter for the interpreter at /HOME/path/.pixi/envs/default/bin/python
2024-08-07 15:35:42.061 [error] 
EnvironmentLocationNotFound: Not a conda environment: /HOME/mambaforge/envs/default


2024-08-07 15:35:42.198 [info] Send text to terminal: /HOME/mambaforge/bin/conda install --name default pytest -y
2024-08-07 15:35:42.522 [error] Subprocess exited unsuccessfully with exit code 1 and signal null on workspace /HOME/path.
2024-08-07 15:35:42.522 [error] Subprocess exited unsuccessfully with exit code 1 and signal null on workspace /HOME/path. Creating and sending error discovery payload
2024-08-07 15:35:42.535 [error] pytest test discovery error for workspace:  /HOME/path 
  
 The python test process was terminated before it could exit on its own, the process errored with: Code: 1, Signal: null for workspace /HOME/path
2024-08-07 15:35:42.896 [warning] could not find a pixi interpreter for the interpreter at /HOME/path
2024-08-07 15:35:42.919 [info] > ~/mambaforge/bin/conda run -n default --no-capture-output python ~/.vscode-server/extensions/ms-python.python-2024.12.2-linux-x64/python_files/get_output_via_markers.py -c "import pytest"

It says it cannot find pixi interpreter, but I actually have pixi installed and setup as my python interpreter.

@oldgithubman
Copy link

Same error here and this is the first I've heard of pixi

@jepManalo
Copy link

I am actually also encountering this pixi error on my VS Code after the update. Right now, pytest Discovery is displaying errors that I have never seen before.

My current Versions are: pytest 7.2.2 pytest bdd 7.1.2 pluggy 1.0.0 VSCode 1.91.1 python 3.8.10

Here is the complete error:

`2024-07-12 15:09:10.914 [info] Experiment 'pythonaacf' is active 2024-07-12 15:09:10.915 [info] Experiment 'pythonCreateEnvOnPipInstall' is active 2024-07-12 15:09:10.915 [info] Experiment 'pythonRecommendTensorboardExt' is active 2024-07-12 15:09:10.915 [info] Experiment 'pythonTerminalEnvVarActivation' is active 2024-07-12 15:09:10.915 [info] Experiment 'pythonTestAdapter' is active 2024-07-12 15:09:10.915 [error] Reading directory to watch failed [Error: ENOENT: no such file or directory, scandir 'c:<project_name>.pixi\envs' at Object.readdirSync (node:fs:1515:3) at t.readdirSync (node:electron/js2c/node_init:2:11289) at c:\Users.vscode\extensions\ms-python.python-2024.10.0-win32-x64\out\client\extension.js:2:574598 at c:\Users.vscode\extensions\ms-python.python-2024.10.0-win32-x64\out\client\extension.js:2:574789 at Array.map () at d.initWatchers (c:\Users.vscode\extensions\ms-python.python-2024.10.0-win32-x64\out\client\extension.js:2:574507) at async d.ensureWatchersReady (c:\Users.vscode\extensions\ms-python.python-2024.10.0-win32-x64\out\client\extension.js:2:536827)] { errno: -4058, syscall: 'scandir', code: 'ENOENT', path: 'c:<project_name>.pixi\envs' } 2024-07-12 15:09:10.915 [error] Dir "c:<project_name>.pixi\envs" is not watchable (directory does not exist) 2024-07-12 15:09:10.915 [info] Default formatter is set to null for workspace c:<project_name> 2024-07-12 15:09:10.958 [info] Python interpreter path: ..venv\Scripts\python.exe 2024-07-12 15:09:11.763 [info] > pyenv which python 2024-07-12 15:09:11.763 [info] cwd: . 2024-07-12 15:09:11.848 [info] > conda info --json 2024-07-12 15:09:12.491 [info] > pixi --version 2024-07-12 15:09:12.511 [error] [Error: spawn pixi ENOENT at ChildProcess.handle.onexit (node:internal/child_process:286:19) at onErrorNT (node:internal/child_process:484:16) at process.processTicksAndRejections (node:internal/process/task_queues:82:21)] { errno: -4058, code: 'ENOENT', syscall: 'spawn pixi', path: 'pixi', spawnargs: [ '--version' ] } 2024-07-12 15:09:12.512 [warning] could not find a pixi interpreter for the interpreter at c:<project_name>.venv\Scripts\python.exe 2024-07-12 15:09:12.803 [info] > & ./.venv/Scripts/Activate.ps1 ; echo 'e8b39361-0157-4923-80e1-22d70d46dee6' ; python ~/.vscode/extensions/ms-python.python-2024.10.0-win32-x64/python_files/printEnvVariables.py 2024-07-12 15:09:12.803 [info] shell: powershell 2024-07-12 15:09:14.207 [info] Discover tests for workspace name: <project_name> - uri: c:<project_name> 2024-07-12 15:09:14.207 [info] Running discovery for pytest using the new test adapter. 2024-07-12 15:09:14.231 [warning] The cwd resolves to a different path, checking if it has a symbolic link somewhere in its path. 2024-07-12 15:09:14.233 [warning] could not find a pixi interpreter for the interpreter at c:<project_name>.venv\Scripts\python.exe 2024-07-12 15:09:14.562 [info] > ./.venv/Scripts/activate.bat && echo 'e8b39361-0157-4923-80e1-22d70d46dee6' && python ~/.vscode/extensions/ms-python.python-2024.10.0-win32-x64/python_files/printEnvVariables.py 2024-07-12 15:09:14.562 [info] shell: commandPrompt 2024-07-12 15:09:14.841 [info] > C:\ProgramData\anaconda3\Scripts\conda.exe info --json 2024-07-12 15:09:15.309 [info] > ~\AppData\Local\Programs\Python\Python38\python.exe ~/.vscode/extensions/ms-python.python-2024.10.0-win32-x64/python_files/printEnvVariables.py 2024-07-12 15:09:15.309 [info] shell: powershell 2024-07-12 15:09:15.312 [warning] could not find a pixi interpreter for the interpreter at c:<project_name>.venv\Scripts\python.exe 2024-07-12 15:09:15.335 [info] > ..venv\Scripts\python.exe -m pytest -p vscode_pytest --collect-only . 2024-07-12 15:09:15.335 [info] cwd: . 2024-07-12 15:09:15.417 [info] Starting Pylance language server. 2024-07-12 15:09:16.116 [info] Prepending environment variable PATH in collection with c:\Users.vscode\extensions\ms-python.python-2024.10.0-win32-x64\python_files\deactivate\powershell;C:<project_name>.venv\Scripts; {"applyAtShellIntegration":true,"applyAtProcessCreation":true} 2024-07-12 15:09:16.116 [info] Setting environment variable VIRTUAL_ENV in collection to C:<project_name>.venv {"applyAtShellIntegration":true,"applyAtProcessCreation":true} 2024-07-12 15:09:16.909 [error] Traceback (most recent call last): File "C:\Users\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 194, in run_module_as_main return run_code(code, main_globals, None, File "C:\Users\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 87, in run_code exec(code, run_globals) File "c:<project_name>.venv\lib\site-packages\pytest__main.py", line 5, in raise SystemExit(pytest.console_main()) File "c:<project_name>.venv\lib\site-packages_pytest\config__init.py", line 189, in console_main code = main() File "c:<project_name>.venv\lib\site-packages_pytest\config__init__.py", line 147, in main config = prepareconfig(args, plugins) File "c:<project_name>.venv\lib\site-packages_pytest\config__init_.py", line 328, in prepareconfig config = pluginmanager.hook.pytest_cmdline_parse( File "c:<project_name>.venv\lib\site-packages\pluggy_hooks.py", line 265, in call return self.hookexec(self.name, self.get_hookimpls(), kwargs, firstresult) File "c:<project_name>.venv\lib\site-packages\pluggy_manager.py", line 80, in hookexec return self.inner_hookexec(hook_name, methods, kwargs, firstresult) File "c:<project_name>.venv\lib\site-packages\pluggy_callers.py", line 55, in multicall gen.send(outcome) File "c:<project_name>.venv\lib\site-packages_pytest\helpconfig.py", line 103, in pytest_cmdline_parse config: Config = outcome.get_result() File "c:<project_name>.venv\lib\site-packages\pluggy_result.py", line 60, in get_result raise ex[1].with_traceback(ex[2]) File "c:<project_name>.venv\lib\site-packages\pluggy_callers.py", line 39, in multicall res = hook_impl.function(*args) File "c:<project_name>.venv\lib\site-packages_pytest\config__init.py", line 1075, in pytest_cmdline_parse self.parse(args) File "c:<project_name>.venv\lib\site-packages_pytest\config__init.py", line 1425, in parse self.preparse(args, addopts=addopts) File "c:<project_name>.venv\lib\site-packages_pytest\config__init.py", line 1301, in preparse self.pluginmanager.consider_preparse(args, exclude_only=False) File "c:<project_name>.venv\lib\site-packages_pytest\config__init.py", line 710, in consider_preparse self.consider_pluginarg(parg) File "c:<project_name>.venv\lib\site-packages_pytest\config__init__.py", line 736, in consider_pluginarg self.import_plugin(arg, consider_entry_points=True) File "c:<project_name>.venv\lib\site-packages_pytest\config__init__.py", line 782, in import_plugin import(importspec) File "", line 991, in find_and_load File "", line 975, in find_and_load_unlocked File "", line 671, in load_unlocked File "c:<project_name>.venv\lib\site-packages_pytest\assertion\rewrite.py", line 178, in exec_module exec(co, module.dict) File "c:\Users.vscode\extensions\ms-python.python-2024.10.0-win32-x64\python_files\vscode_pytest__init.py", line 895, in class DeferPlugin: File "c:\Users.vscode\extensions\ms-python.python-2024.10.0-win32-x64\python_files\vscode_pytest__init_.py", line 896, in DeferPlugin @pytest.hookimpl(wrapper=True) TypeError: call() got an unexpected keyword argument 'wrapper'

2024-07-12 15:09:16.987 [error] Subprocess exited unsuccessfully with exit code 1 and signal null on workspace c:<project_name>. 2024-07-12 15:09:16.987 [error] Subprocess exited unsuccessfully with exit code 1 and signal null on workspace c:<project_name>. Creating and sending error discovery payload 2024-07-12 15:09:16.987 [error] pytest test discovery error for workspace: c:<project_name>

The python test process was terminated before it could exit on its own, the process errored with: Code: 1, Signal: null for workspace c:<project_name> `

I was able to fix this by upgrading pytest to the latest version. I suggest everyone who is encountering this do it too.

@eleanorjboyd
Copy link
Member

@anthonykim1, could you circle around on this as you have made fixes in this area? Thanks!

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Aug 28, 2024
@anthonykim1
Copy link

anthonykim1 commented Aug 28, 2024

You won't see the --version as error nor "2024-07-16 12:15:12.324 [error] Reading directory to watch failed [Error: ENOENT: no such file or directory, scandir '/home/path_to_the_project/.pixi/envs'". Try clearing the output and downloading the latest version of Python extension. Related: https://github.com//pull/23942

@bernardo-suez
Copy link

bernardo-suez commented Sep 11, 2024

I have upgraded from pytest 8.3.2 to 8.3.3 but still have the same warning, which I believe is preventing Python/pytest to find packages in my data environment---see log below. This issue started yesterday, probably after an update (I don't recall if the update was yesterday or the day before). Downgreading the Python extension to 2024.12.3 (version I had last week when things were working) didn't help.

2024-09-11 09:25:55.537 [warning] could not find a pixi interpreter for the interpreter at C:\Users\btrindad\AppData\Local\anaconda3\envs\data\python.exe
2024-09-11 09:25:55.570 [info] > python -m pytest -p vscode_pytest --collect-only tests
2024-09-11 09:25:55.570 [info] cwd: .
2024-09-11 09:25:57.457 [info] ============================= test session starts =============================
platform win32 -- Python 3.11.5, pytest-7.4.0, pluggy-1.0.0

2024-09-11 09:25:57.465 [info] rootdir: c:\Users\btrindad\Desktop\BUs\VWPA\harrisburg-hyd-model-calibration
plugins: anyio-3.5.0

2024-09-11 09:26:04.318 [info] collected 18 items / 2 errors

<Package tests>

2024-09-11 09:26:04.318 [info]   <Module test_calibration_plotter.py>
    <Function test_initialization>
    <Function test_process_model_tank_results>
    <Function test_process_model_flow_results>
    <Function test_process_model_results>
    <Function test_plot_calibration>
    <Function test_group_sum_flows>
    <Function test_calc_calib_error>
    <Function test_plot_calibration_deviations>
  <Module test_outlier_replacement.py>
    <Function test_with_valid_inputs>
    <Function test_with_no_outliers>
    <Function test_with_non_existent_columns>
    <Function test_with_specific_time_ranges>
    <Function test_with_invalid_time_ranges>
    <Function test_with_valid_dataframe>
    <Function test_with_empty_dataframe>
    <Function test_with_non_datetime_index>
    <Function test_with_different_quantile_and_multiplier>
    <Function test_with_missing_data>

2024-09-11 09:26:04.383 [error] pytest test discovery error for workspace:  c:\Users\btrindad\Desktop\BUs\VWPA\harrisburg-hyd-model-calibration 
 _pytest.nodes.Collector.CollectError: ImportError while importing test module 'c:\Users\btrindad\Desktop\BUs\VWPA\harrisburg-hyd-model-calibration\tests\test_ccb_downscaler.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
..\..\..\..\AppData\Local\anaconda3\Lib\importlib\__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests\test_ccb_downscaler.py:4: in <module>
    from typeguard import TypeCheckError
E   ModuleNotFoundError: No module named 'typeguard'
 Check Python Test Logs for more details.

_pytest.nodes.Collector.CollectError: ImportError while importing test module 'c:\Users\btrindad\Desktop\BUs\VWPA\harrisburg-hyd-model-calibration\tests\test_water_distribution_tool.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
..\..\..\..\AppData\Local\anaconda3\Lib\importlib\__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests\test_water_distribution_tool.py:4: in <module>
    from shapely import Polygon
E   ModuleNotFoundError: No module named 'shapely'
 Check Python Test Logs for more details.

Interrupted: 2 errors during collection
 Check Python Test Logs for more details.

@toddsayersshell
Copy link

toddsayersshell commented Sep 11, 2024

@bernardo-suez Your errors do not appear to be related to this issue. I'm not attempting to defend Github or Microsoft (I'm pretty annoyed with them, TBH). However...

You appear to have problem with your PYTHONPATH and/or how you are attempting to import packages. This appears to be unrelated to the Pixi errors we're describing, here.

EDIT: Ah... I do see that the very first line mentions the Pixi issue. Honestly... I've given up on the GH/MS dev team. I just have to ignore that error. The OTHER errors are unrelated. Also... Windows??? Level-up, yo...

@oldgithubman
Copy link

oldgithubman commented Sep 12, 2024

Also... Windows??? Level-up, yo...

Wake me up when Linux has proper HDR support

(I do main Linux though)

@zljubisic
Copy link

@eleanorjboyd can you please help us solving this issue?
After blocking automatic update and downgrading vscode and python extension - pytest works.
Are mine versions of vscode/python last working versions or we will be able to upgrade them again in the future?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
info-needed Issue requires more information from poster triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

No branches or pull requests