Skip to content

Conversation

@garyvdm
Copy link

@garyvdm garyvdm commented Jan 13, 2026

When I run the python tests, I get these warnings: This PR fixes these.

========================================================= warnings summary =========================================================
python_files/unittestadapter/pvsc_utils.py:26
  /home/gary/dev/vscode-python/python_files/unittestadapter/pvsc_utils.py:26: PytestCollectionWarning: cannot collect test class 'TestNodeTypeEnum' because it has a __new__ constructor (from: tests/unittestadapter/test_discovery.py)
    class TestNodeTypeEnum(str, enum.Enum):

python_files/unittestadapter/pvsc_utils.py:45
  /home/gary/dev/vscode-python/python_files/unittestadapter/pvsc_utils.py:45: PytestCollectionWarning: cannot collect test class 'TestNode' because it has a __init__ constructor (from: tests/unittestadapter/test_utils.py)
    class TestNode(TestData):

python_files/unittestadapter/pvsc_utils.py:26
  /home/gary/dev/vscode-python/python_files/unittestadapter/pvsc_utils.py:26: PytestCollectionWarning: cannot collect test class 'TestNodeTypeEnum' because it has a __new__ constructor (from: tests/unittestadapter/test_utils.py)
    class TestNodeTypeEnum(str, enum.Enum):

… classes that begin with Test, so that pytest doesn't try use them a tests.
@garyvdm garyvdm changed the title Fix unittestadapter test warnings by using different import names for classes that begin with Test, so that pytest doesn't try use them a tests. Fix unittestadapter test warnings by using different import names for classes that begin with Test, so that pytest doesn't try use them as tests. Jan 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant