Skip to content

pytest_xdist_auto_num_workers pytest missing module config #23822

Closed as not planned
@TheBurchLog

Description

@TheBurchLog

Type: Bug

Behaviour

Primary Error Message:

def pytest_xdist_auto_num_workers(self, config: pytest.Config) -> Generator[None, int, int]:
AttributeError: module 'pytest' has no attribute 'Config'

Steps to reproduce:

  1. Running unit tests with version v2024.8.1
  2. Upgrade to version v2024.10.0

Unit test are ran against our repo:
https://github.com/beer-garden/beer-garden

Pytest version: 6.2.5

Diagnostic data

2024-07-16 12:02:48.934 [info] Experiment 'pythonCreateEnvOnPipInstall' is active
2024-07-16 12:02:48.934 [info] Experiment 'pythonRecommendTensorboardExt' is active
2024-07-16 12:02:48.934 [info] Experiment 'pythonTerminalEnvVarActivation' is active
2024-07-16 12:02:48.934 [info] Experiment 'pythonTestAdapter' is active
2024-07-16 12:02:48.934 [error] Reading directory to watch failed [Error: ENOENT: no such file or directory, scandir '/beer-garden/.pixi/envs'
	at Object.readdirSync (node:fs:1515:26)
	at /.vscode-server/extensions/ms-python.python-2024.10.0-linux-x64/out/client/extension.js:2:574598
	at /.vscode-server/extensions/ms-python.python-2024.10.0-linux-x64/out/client/extension.js:2:574789
	at Array.map (<anonymous>)
	at d.initWatchers (/.vscode-server/extensions/ms-python.python-2024.10.0-linux-x64/out/client/extension.js:2:574507)
	at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
	at async d.ensureWatchersReady (/.vscode-server/extensions/ms-python.python-2024.10.0-linux-x64/out/client/extension.js:2:536827)] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'scandir',
  path: '/beer-garden/.pixi/envs'
}
2024-07-16 12:02:48.934 [error] Dir "/beer-garden/.pixi/envs" is not watchable (directory does not exist)
2024-07-16 12:02:49.166 [info] Default formatter is set to null for workspace /beer-garden
2024-07-16 12:02:50.160 [info] Python interpreter path: /bin/python
2024-07-16 12:02:51.915 [info] > pyenv which python
2024-07-16 12:02:51.915 [info] cwd: .
2024-07-16 12:02:52.667 [info] > pixi --version
2024-07-16 12:02:52.712 [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-16 12:02:52.712 [warning] could not find a pixi interpreter for the interpreter at /bin/python
2024-07-16 12:02:54.215 [info] Starting Pylance language server.
2024-07-16 12:03:31.522 [info] Discover tests for workspace name: beer-garden - uri: /beer-garden
2024-07-16 12:03:31.522 [info] Running discovery for pytest using the new test adapter.
2024-07-16 12:03:31.524 [info] All environment variables set for pytest discovery: <OMITTED>
2024-07-16 12:03:31.524 [warning] could not find a pixi interpreter for the interpreter at /bin/python
2024-07-16 12:03:31.556 [info] > pyenv which python
2024-07-16 12:03:31.556 [info] cwd: .
2024-07-16 12:03:31.564 [warning] could not find a pixi interpreter for the interpreter at /bin/python
2024-07-16 12:03:31.574 [info] > /bin/python -m pytest -p vscode_pytest --collect-only src/app/test
2024-07-16 12:03:31.574 [info] cwd: .
2024-07-16 12:03:31.901 [error] Traceback (most recent call last):

2024-07-16 12:03:31.901 [error]   File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main

2024-07-16 12:03:31.901 [error]     
2024-07-16 12:03:31.902 [error] return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code

2024-07-16 12:03:31.902 [error]     exec(code, run_globals)
  File "/.local/lib/python3.10/site-packages/pytest/__main__.py", line 5, in <module>

2024-07-16 12:03:31.903 [error]     raise SystemExit(pytest.console_main())
  File "/.local/lib/python3.10/site-packages/_pytest/config/__init__.py", line 185, in console_main

2024-07-16 12:03:31.904 [error]     code = main()
  File "/.local/lib/python3.10/site-packages/_pytest/config/__init__.py", line 143, in main

2024-07-16 12:03:31.905 [error]     config = _prepareconfig(args, plugins)
  File "/.local/lib/python3.10/site-packages/_pytest/config/__init__.py", line 318, in _prepareconfig
    config = pluginmanager.hook.pytest_cmdline_parse(
  File "/.local/lib/python3.10/site-packages/pluggy/_hooks.py", line 433, in __call__

2024-07-16 12:03:31.906 [error]     return self._hookexec(self.name, self._hookimpls, kwargs, firstresult)
  File "/.local/lib/python3.10/site-packages/pluggy/_manager.py", line 112, in _hookexec

2024-07-16 12:03:31.907 [error]     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  File "/.local/lib/python3.10/site-packages/pluggy/_callers.py", line 133, in _multicall

2024-07-16 12:03:31.909 [error]     teardown[0].send(outcome)
  File "/.local/lib/python3.10/site-packages/_pytest/helpconfig.py", line 100, in pytest_cmdline_parse

2024-07-16 12:03:31.910 [error]     config: Config = outcome.get_result()
  File "/.local/lib/python3.10/site-packages/pluggy/_result.py", line 108, in get_result

2024-07-16 12:03:31.910 [error]     raise exc.with_traceback(exc.__traceback__)
  File "/.local/lib/python3.10/site-packages/pluggy/_callers.py", line 80, in _multicall
    res = hook_impl.function(*args)
  File "/.local/lib/python3.10/site-packages/_pytest/config/__init__.py", line 1003, in pytest_cmdline_parse

2024-07-16 12:03:31.911 [error]     self.parse(args)
  File "/.local/lib/python3.10/site-packages/_pytest/config/__init__.py", line 1283, in parse

2024-07-16 12:03:31.912 [error]     self._preparse(args, addopts=addopts)
  File "/.local/lib/python3.10/site-packages/_pytest/config/__init__.py", line 1168, in _preparse

2024-07-16 12:03:31.912 [error]     self.pluginmanager.consider_preparse(args, exclude_only=False)
  File "/.local/lib/python3.10/site-packages/_pytest/config/__init__.py", line 635, in consider_preparse

2024-07-16 12:03:31.912 [error]     self.consider_pluginarg(parg)
  File "/.local/lib/python3.10/site-packages/_pytest/config/__init__.py", line 660, in consider_pluginarg

2024-07-16 12:03:31.912 [error]     self.import_plugin(arg, consider_entry_points=True)
  File "/.local/lib/python3.10/site-packages/_pytest/config/__init__.py", line 703, in import_plugin

2024-07-16 12:03:31.912 [error]     __import__(importspec)
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load

2024-07-16 12:03:31.913 [error]   File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked

2024-07-16 12:03:31.913 [error]   File "<frozen importlib._bootstrap>", line 688, in _load_unlocked

2024-07-16 12:03:31.913 [error]   File "/.local/lib/python3.10/site-packages/_pytest/assertion/rewrite.py", line 170, in exec_module

2024-07-16 12:03:31.914 [error]     exec(co, module.__dict__)
  File "/.vscode-server/extensions/ms-python.python-2024.10.0-linux-x64/python_files/vscode_pytest/__init__.py", line 895, in <module>

2024-07-16 12:03:31.916 [error]     class DeferPlugin:
  File "/.vscode-server/extensions/ms-python.python-2024.10.0-linux-x64/python_files/vscode_pytest/__init__.py", line 897, in DeferPlugin

2024-07-16 12:03:31.916 [error]     def pytest_xdist_auto_num_workers(self, config: pytest.Config) -> Generator[None, int, int]:
AttributeError: module 'pytest' has no attribute 'Config'

2024-07-16 12:03:31.990 [error] Subprocess exited unsuccessfully with exit code 1 and signal null on workspace /beer-garden.
2024-07-16 12:03:31.990 [error] Subprocess exited unsuccessfully with exit code 1 and signal null on workspace /beer-garden. Creating and sending error discovery payload
2024-07-16 12:03:31.990 [error] pytest test discovery error for workspace:  /beer-garden 
  
 The python test process was terminated before it could exit on its own, the process errored with: Code: 1, Signal: null for workspace /beer-garden

Extension version: 2024.10.0
VS Code version: Code 1.91.1 (f1e16e1e6214d7c44d078b1f0607b2388f29d729, 2024-07-09T22:06:49.809Z)
OS version: Windows_NT x64 10.0.19045
Modes:
Remote OS version: Linux x64 6.5.0-41-generic
Remote OS version: Linux x64 6.5.0-41-generic

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


languageServer: "Pylance"

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

Installed Extensions
Extension Name Extension Id Version
autoDocstring - Python Docstring Generator njpwerner.autodocstring 0.6.1
Chrome Extension Developer Tools aaravb.chrome-extension-developer-tools 2.0.4
Code Coverage markis.code-coverage 1.12.0
Code Spell Checker streetsidesoftware.code-spell-checker 3.0.1
Docker ms-azuretools.vscode-docker 1.29.1
JavaScript Debugger ms-vscode.js-debug 1.91.0
Pylance ms-python.vscode-pylance 2024.7.1
Python ms-python.python 2024.10.0
Python Debugger ms-python.debugpy 2024.8.0
Table Visualizer for JavaScript Profiles ms-vscode.vscode-js-profile-table 1.0.9
System Info
Item Value
CPUs Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz (8 x 3600)
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) 31.92GB (16.36GB free)
Process Argv --crash-reporter-id 5b963a74-e961-4f03-bfe9-af0f571f4db5
Screen Reader no
VM 40%
Item Value
Remote SSH: BeerGarden
OS Linux x64 6.5.0-41-generic
CPUs Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz (2 x 0)
Memory (System) 3.72GB (2.06GB free)
VM 43%
Item Value
Remote SSH: BeerGarden
OS Linux x64 6.5.0-41-generic
CPUs Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz (2 x 0)
Memory (System) 3.72GB (2.06GB free)
VM 43%
A/B Experiments
vsliv368cf:30146710
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805:30301674
binariesv615:30325510
vsaa593cf:30376535
py29gd2263:31024239
c4g48928:30535728
azure-dev_surveyone:30548225
962ge761:30959799
pythongtdpath:30769146
welcomedialogc:30910334
pythonnoceb:30805159
asynctok:30898717
pythonregdiag2:30936856
pythonmypyd1:30879173
2e7ec940:31000449
pythontbext0:30879054
accentitlementsc:30995553
dsvsc016:30899300
dsvsc017:30899301
dsvsc018:30899302
cppperfnew:31000557
dsvsc020:30976470
pythonait:31006305
chatpanelt:31048053
dsvsc021:30996838
01bff139:31013167
pythoncenvpt:31062603
a69g1124:31058053
dvdeprecation:31068756
dwnewjupytercf:31046870
newcmakeconfigv2:31071590
impr_priority:31094925
pythonrstrctxtcf:31093870
0c838689:31092287

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions