refactor(testing): deprecate testtools TestCase rebase#2687
refactor(testing): deprecate testtools TestCase rebase#2687l46983284-cpu wants to merge 4 commits into
Conversation
8a14a30 to
877ef0a
Compare
|
Rebased onto current Local: |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2687 +/- ##
===========================================
- Coverage 100.00% 97.03% -2.97%
===========================================
Files 64 64
Lines 7987 8021 +34
Branches 1105 1112 +7
===========================================
- Hits 7987 7783 -204
- Misses 0 204 +204
- Partials 0 34 +34 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Emit DeprecatedWarning when falcon.testing.TestCase auto-rebases onto testtools, add FALCON_TESTING_TESTCASE_BASE escape hatch, and document unittest/pytest as the preferred path until Falcon 5.0 removes the integration. Closes falconry#2156 Signed-off-by: Alex Chen <l46983284@gmail.com>
Apply ruff import order/line length and document the deprecation with a versionchanged directive on TestCase. Signed-off-by: Alex Chen <l46983284@gmail.com>
mypy --strict rejects a runtime-resolved base class variable as a type even with type: ignore[misc]; cover valid-type for the deprecation path. Signed-off-by: Alex Chen <l46983284@gmail.com>
ad00923 to
8c972ec
Compare
|
Pushed a typing fix for the CI mypy jobs: the runtime-resolved
|
Expand TestCase type: ignore for runtime-selected base class and keep falcon.testing.helpers importable under installed layouts used by CI. Signed-off-by: Alex Chen <l46983284@gmail.com>
Summary of Changes
Deprecate the automatic
testtools.TestCaserebase offalcon.testing.TestCase.When
testtoolsis installed and no custom base is configured, Falcon still usestesttools.TestCasefor compatibility, but now emitsDeprecatedWarningonceand points people at
unittest/pytest. Full removal is left for Falcon 5.0.Escape hatch: set
FALCON_TESTING_TESTCASE_BASEto an import path(
module:attributeormodule.attribute), for exampletesttools:TestCaseora project-specific base class.
Docs: FAQ testing section no longer reads like
testtoolsis preferred.Tests cover default unittest path, implicit testtools deprecation, env override,
and invalid specs.
Assisted by an LLM for the first draft; I reviewed and tested the change before
opening this PR.
Related Issues
Closes #2156
Pull Request Checklist
tox.docs/.docs/.versionadded,versionchanged, ordeprecateddirectives.docs/_newsfragments/, with the file name format{issue_number}.{fragment_type}.rst. (Runtox -e towncrier, and inspectdocs/_build/html/changes/in the browser to ensure it renders correctly.)