Skip to content

Fix the warnings pytest reports for the test suites - #1039

Merged
notroj merged 1 commit into
apache:trunkfrom
notroj:pytest-fixture-warnings
Nov 15, 2026
Merged

notroj merged 1 commit into
apache:trunkfrom
notroj:pytest-fixture-warnings

Conversation

@notroj

@notroj notroj commented Nov 15, 2026

Copy link
Copy Markdown
Collaborator

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/modules now use @classmethod and cls, the form 23 fixtures in the tree already used. Four helper methods those fixtures call, none of which used self, become @staticmethod.

The rest are one-offs: an empty pytest.mark.usefixtures() used as a no-op decorator in test_108_goaway.py, parametrize(enumerate(...)) in test_proxy_beacon_input.py, and two invalid string escapes.

One of those escapes changes what a test sends. test_http_strict.py had "http://foo\@localhost:80/", carried over from Perl where \@ is a literal @; in Python it sent a backslash. It now sends foo@localhost, as the original did, and the expected statuses still hold.

🤖 Generated with Claude Code

* 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>
@notroj
notroj merged commit 15181bb into apache:trunk Nov 15, 2026
46 checks passed
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