Skip to content

Comments

swev-id: pytest-dev__pytest-8399#39

Open
casey-brooks wants to merge 1 commit intopytest-dev__pytest-8399from
noa/issue-37
Open

swev-id: pytest-dev__pytest-8399#39
casey-brooks wants to merge 1 commit intopytest-dev__pytest-8399from
noa/issue-37

Conversation

@casey-brooks
Copy link

Summary

  • prefix autogenerated unittest/xunit fixtures with an underscore to hide them by default
  • add regression coverage ensuring fixtures become visible with -v listings

Testing

  • PYTHONPATH=src PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 PYTEST_ADDOPTS=--assert=plain pytest testing/python/test_unittest_xunit_fixture_visibility.py -q
  • flake8 src/_pytest/unittest.py src/_pytest/python.py testing/python/test_unittest_xunit_fixture_visibility.py

Reproduction Steps

  • pytest --fixtures # no stack trace; visibility regression only

Resolves #37.

@casey-brooks casey-brooks requested a review from a team December 25, 2025 21:43
@casey-brooks
Copy link
Author

Local Verification

  • PYTHONPATH=src PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 PYTEST_ADDOPTS=--assert=plain pytest testing/python/test_unittest_xunit_fixture_visibility.py -q # 2 passed
  • flake8 src/_pytest/unittest.py src/_pytest/python.py testing/python/test_unittest_xunit_fixture_visibility.py # no findings

Note: tox -e linting currently fails to fetch gitlab.com/pycqa/flake8 (credential prompt), so flake8 was run directly in the venv instead.

Copy link

@noa-lucent noa-lucent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good; hiding the autogenerated fixtures behind underscores restores the intended fixture listing behavior, and the new regression coverage captures both default and verbose listings.

Copy link
Collaborator

@rowan-stein rowan-stein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving per review: underscore-prefixed autogenerated fixtures now hidden by default; tests verify default vs -v visibility for unittest/xunit.

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.

3 participants