Skip to content

Error discoverying pytests on Windows #21540

Description

Opening a workspace or configuring tests to run with pytest results in the following error on my machine:

023-06-29 14:27:19.656 [info] Discover tests for workspace name: slow-pytest - uri: c:\Users\conno\Downloads\foo\slow-pytest
2023-06-29 14:27:19.656 [info] Running discovery for pytest using the new test adapter.
2023-06-29 14:27:19.663 [info] > conda run -p C:\ProgramData\Anaconda3 --no-capture-output python ~\.vscode-insiders\extensions\ms-python.python-2023.11.11801006\pythonFiles\get_output_via_markers.py -m pytest -p vscode_pytest --collect-only .
2023-06-29 14:27:19.663 [info] cwd: .
2023-06-29 14:27:21.274 [info] Test server connected to a client.
2023-06-29 14:27:21.275 [info] Using result resolver for discovery
2023-06-29 14:27:21.275 [error] pytest test discovery error 
 Error Occurred, traceback: Traceback (most recent call last):
  File "c:\Users\conno\.vscode-insiders\extensions\ms-python.python-2023.11.11801006\pythonFiles\vscode_pytest\__init__.py", line 218, in pytest_sessionfinish
    session_node: Union[TestNode, None] = build_test_tree(session)
  File "c:\Users\conno\.vscode-insiders\extensions\ms-python.python-2023.11.11801006\pythonFiles\vscode_pytest\__init__.py", line 259, in build_test_tree
    session_node = create_session_node(session)
  File "c:\Users\conno\.vscode-insiders\extensions\ms-python.python-2023.11.11801006\pythonFiles\vscode_pytest\__init__.py", line 404, in create_session_node
    "path": session.path,
AttributeError: 'Session' object has no attribute 'path'

Activity

  1. connor4312 commented on Jun 30, 2023

    @connor4312
    MemberAuthor

    Verified the fix in #21548

  2. eleanorjboyd commented on Jul 5, 2023

    @eleanorjboyd

    Great thank you!

  3. locked as resolved and limited conversation to collaborators on Sep 2, 2023
  4. added 2 commits that reference this issue on Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area-testingauthor-verification-requestedIssues potentially verifiable by issue authorbugIssue identified by VS Code Team member as probable bugverifiedVerification succeeded

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions