Skip to content

pytest: silence pytest warnings - #23135

Closed
vszakats wants to merge 10 commits into
curl:masterfrom
vszakats:pytest-warnings
Closed

vszakats wants to merge 10 commits into
curl:masterfrom
vszakats:pytest-warnings

Conversation

@vszakats

@vszakats vszakats commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

Fixing:

[...]
=============================== warnings summary ===============================
tests/http/test_02_download.py: 3 warnings
tests/http/test_07_upload.py: 2 warnings
tests/http/test_10_proxy.py: 3 warnings
tests/http/test_11_unix.py: 1 warning
tests/http/test_17_ssl_use.py: 4 warnings
tests/http/test_08_caddy.py: 2 warnings
tests/http/test_14_auth.py: 1 warning
tests/http/test_16_info.py: 1 warning
tests/http/test_09_push.py: 1 warning
tests/http/test_19_shutdown.py: 2 warnings
tests/http/test_21_resolve.py: 4 warnings
tests/http/test_20_websockets.py: 4 warnings
tests/http/test_18_methods.py: 1 warning
  /Users/runner/venv/lib/python3.14/site-packages/_pytest/fixtures.py:1313: PytestRemovedIn10Warning: Class-scoped fixture defined as instance method is deprecated.
  Instance attributes set in this fixture will NOT be visible to test methods,
  as each test gets a new instance while the fixture runs only once per class.
  Use @classmethod decorator and set attributes on cls instead.
  See https://docs.pytest.org/en/stable/deprecations.html#class-scoped-fixture-as-instance-method
    fixturefunc = resolve_fixture_function(fixturedef, request)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========== 629 passed, 215 skipped, 29 warnings in 80.93s (0:01:20) ===========

Ref: https://github.com/curl/curl/actions/runs/36406255757/job/108875619244

Ref: https://docs.pytest.org/en/stable/deprecations.html#class-scoped-fixture-as-instance-method

@vszakats vszakats added the tests label Sep 28, 2026
@github-actions github-actions Bot added the HTTP label Sep 28, 2026
@vszakats
vszakats marked this pull request as draft September 28, 2026 10:52
@vszakats
vszakats requested a balanced review from Copilot September 28, 2026 10:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The targeted change correctly resolves the pytest deprecation without altering test behavior.

Review effort: Balanced
Findings: None

What changed in this PR

Updates the Unix socket pytest fixture to follow pytest’s class-scoped fixture requirements and eliminate the deprecation warning.

Changes:

  • Converts uds_faker into a class method.
File Description
tests/​http/​test_11_unix.py Adds @classmethod to the class-scoped fixture.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

This comment was marked as resolved.

@vszakats vszakats changed the title [TEST] pytests: try silencing warnings pytests: silence pytest warnings Sep 28, 2026
@vszakats
vszakats requested a balanced review from Copilot September 28, 2026 11:43
@vszakats
vszakats marked this pull request as ready for review September 28, 2026 11:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The changes consistently follow pytest’s prescribed class-scoped fixture form without altering test behavior.

Review effort: Balanced
Findings: None

Resolved since last review (4)

@vszakats vszakats changed the title pytests: silence pytest warnings pytest: silence pytest warnings Sep 28, 2026
@vszakats vszakats closed this in c345611 Sep 28, 2026
@vszakats
vszakats deleted the pytest-warnings branch September 28, 2026 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants