Repository navigation
Fix the warnings pytest reports for the test suites - #1039
Merged
Merged
Conversation
* test/modules/*/test_*.py, test/modules/arch/linux/test_*.py: Make class-scoped fixtures class methods. * test/modules/http2/test_800_websockets.py (TestWebSockets.ws_check_alive, TestWebSockets._mkpath, TestWebSockets._rmrf), test/modules/md/test_801_stapling.py (TestStapling.configure_httpd): Make static methods. * test/modules/http2/test_108_goaway.py (TestGoaway.test_h2_108_01_idle_timeout): Don't use an empty usefixtures() mark as the no-op decorator. * test/pytest_suite/tests/t/modules/test_proxy_beacon_input.py: Pass lists to parametrize. * test/pytest_suite/tests/t/apache/test_http_strict.py: Send "@" rather than "\@" in the userinfo request, as the Perl original did. * test/pytest_suite/tests/t/modules/test_access.py: Drop invalid escape from docstring. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Clears the roughly 100 warnings at the end of each pytest run. Nearly all come from one deprecation: pytest 9 warns about class-scoped fixtures defined as instance methods and will stop supporting them in pytest 10. The 125 such fixtures under
test/modulesnow use@classmethodandcls, the form 23 fixtures in the tree already used. Four helper methods those fixtures call, none of which usedself, become@staticmethod.The rest are one-offs: an empty
pytest.mark.usefixtures()used as a no-op decorator intest_108_goaway.py,parametrize(enumerate(...))intest_proxy_beacon_input.py, and two invalid string escapes.One of those escapes changes what a test sends.
test_http_strict.pyhad"http://foo\@localhost:80/", carried over from Perl where\@is a literal@; in Python it sent a backslash. It now sendsfoo@localhost, as the original did, and the expected statuses still hold.🤖 Generated with Claude Code