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

NoSource exception is failing to import for earlier coverage versions #24607

Closed
GeorgeNikitinNV opened this issue Dec 16, 2024 · 1 comment · Fixed by #24608
Closed

NoSource exception is failing to import for earlier coverage versions #24607

GeorgeNikitinNV opened this issue Dec 16, 2024 · 1 comment · Fixed by #24608
Assignees
Labels
area-testing bug Issue identified by VS Code Team member as probable bug

Comments

@GeorgeNikitinNV
Copy link

Type: Bug

Behaviour

Run Tests with Coverage fails in VSCode.

Traceback (most recent call last):
  File "[USER_HOME_PATH]/.vscode/extensions/ms-python.python-2024.22.0-darwin-arm64/python_files/vscode_pytest/run_pytest_script.py", line 64, in <module>
    pytest.main(arg_array)
  File "[PACKGE_PATH]/lib/python3.9/site-packages/_pytest/config/__init__.py", line 175, in main
    ret: ExitCode | int = config.hook.pytest_cmdline_main(config=config)
  File "[PACKGE_PATH]/lib/python3.9/site-packages/pluggy/_hooks.py", line 513, in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
  File "[PACKGE_PATH]/lib/python3.9/site-packages/pluggy/_manager.py", line 120, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  File "[PACKGE_PATH]/lib/python3.9/site-packages/pluggy/_callers.py", line 139, in _multicall
    raise exception.with_traceback(exception.__traceback__)
  File "[PACKGE_PATH]/lib/python3.9/site-packages/pluggy/_callers.py", line 103, in _multicall
    res = hook_impl.function(*args)
  File "[PACKGE_PATH]/lib/python3.9/site-packages/_pytest/main.py", line 330, in pytest_cmdline_main
    return wrap_session(config, _main)
  File "[PACKGE_PATH]/lib/python3.9/site-packages/_pytest/main.py", line 318, in wrap_session
    config.hook.pytest_sessionfinish(
  File "[PACKGE_PATH]/lib/python3.9/site-packages/pluggy/_hooks.py", line 513, in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
  File "[PACKGE_PATH]/lib/python3.9/site-packages/pluggy/_manager.py", line 120, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  File "[PACKGE_PATH]/lib/python3.9/site-packages/pluggy/_callers.py", line 139, in _multicall
    raise exception.with_traceback(exception.__traceback__)
  File "[PACKGE_PATH]/lib/python3.9/site-packages/pluggy/_callers.py", line 122, in _multicall
    teardown.throw(exception)  # type: ignore[union-attr]
  File "[PACKGE_PATH]/lib/python3.9/site-packages/_pytest/logging.py", line 868, in pytest_sessionfinish
    return (yield)
  File "[PACKGE_PATH]/lib/python3.9/site-packages/pluggy/_callers.py", line 122, in _multicall
    teardown.throw(exception)  # type: ignore[union-attr]
  File "[PACKGE_PATH]/lib/python3.9/site-packages/_pytest/terminal.py", line 893, in pytest_sessionfinish
    result = yield
  File "[PACKGE_PATH]/lib/python3.9/site-packages/pluggy/_callers.py", line 122, in _multicall
    teardown.throw(exception)  # type: ignore[union-attr]
  File "[PACKGE_PATH]/lib/python3.9/site-packages/_pytest/warnings.py", line 141, in pytest_sessionfinish
    return (yield)
  File "[PACKGE_PATH]/lib/python3.9/site-packages/pluggy/_callers.py", line 103, in _multicall
    res = hook_impl.function(*args)
  File "[USER_HOME_PATH]/.vscode/extensions/ms-python.python-2024.22.0-darwin-arm64/python_files/vscode_pytest/__init__.py", line 445, in pytest_sessionfinish
    from coverage import exceptions
ImportError: cannot import name 'exceptions' from 'coverage' ([PACKGE_PATH]/lib/python3.9/site-packages/coverage/__init__.py)

Steps to reproduce:

  1. Install python 2024.22.0 extension and Python Testing plugin.
  2. pip install coverage==5.5
  3. Run tests with coverage from testing plugin/

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.22.0
VS Code version: Code 1.96.0 (138f619c86f1199955d53b4166bef66ef252935c, 2024-12-11T02:29:09.626Z)
OS version: Darwin arm64 23.5.0
Modes:

System Info
Item Value
CPUs Apple M2 Pro (12 x 2400)
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
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) 3, 5, 5
Memory (System) 32.00GB (0.08GB free)
Process Argv --crash-reporter-id b0cbcaff-9225-44f7-9e5d-85e506c8203e
Screen Reader no
VM 0%
@GeorgeNikitinNV
Copy link
Author

Proposed solution #24608

@eleanorjboyd eleanorjboyd added area-testing bug Issue identified by VS Code Team member as probable bug and removed triage-needed Needs assignment to the proper sub-team labels Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-testing bug Issue identified by VS Code Team member as probable bug
Projects
None yet
2 participants