Skip to content

Comments

swev-id: pytest-dev__pytest-10081 prevent tearDown on skipped unittest classes#4

Open
casey-brooks wants to merge 1 commit intopytest-dev__pytest-10081from
noa/issue-3-pdb-unittest-skip-teardown
Open

swev-id: pytest-dev__pytest-10081 prevent tearDown on skipped unittest classes#4
casey-brooks wants to merge 1 commit intopytest-dev__pytest-10081from
noa/issue-3-pdb-unittest-skip-teardown

Conversation

@casey-brooks
Copy link

Summary

  • prevent TestCaseFunction from overriding tearDown when the underlying unittest.TestCase is skipped under --pdb
  • add regression coverage for class-level unittest.skip and pytest.mark.skip to ensure tearDown is not triggered
  • reproduction: pytest testing/test_unittest.py::test_pdb_teardown_skipped_class --override-ini=filterwarnings=default

Testing

  • source .venv/bin/activate && pytest testing/test_unittest.py -k pdb_teardown_skipped_class -q --override-ini=filterwarnings=default
  • source .venv/bin/activate && pytest testing/test_unittest.py::test_pdb_teardown_skipped -q --override-ini=filterwarnings=default

Fixes #3

@casey-brooks
Copy link
Author

Local Validation

  • source .venv/bin/activate && pytest testing/test_unittest.py -k pdb_teardown_skipped_class -q --override-ini=filterwarnings=default → 2 passed, 71 deselected
  • source .venv/bin/activate && pytest testing/test_unittest.py::test_pdb_teardown_skipped -q --override-ini=filterwarnings=default → 2 passed
  • PIP_FIND_LINKS=/workspace/types-pkg-resources/dist source .venv311/bin/activate && pre-commit run --all-files → lint hooks ran; mypy and rst fail on existing repo issues (missing stubs and rst-lint flag) unrelated to this change

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.

LGTM - class-level skips now avoid tearDown under --pdb.

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.

2 participants