Skip to content

test: suppress aiohttp BasicAuth deprecation warning - #161

Merged
LeyckerS merged 1 commit into
LeyckerS:mainfrom
Divesh-Kshirsagar:fix/151-aiohttp-deprecation-warning
Aug 12, 2026
Merged

test: suppress aiohttp BasicAuth deprecation warning#161
LeyckerS merged 1 commit into
LeyckerS:mainfrom
Divesh-Kshirsagar:fix/151-aiohttp-deprecation-warning

Conversation

@Divesh-Kshirsagar

Copy link
Copy Markdown
Contributor

Description

Adds a targeted pytest warning filter for the aiohttp.BasicAuth deprecation warning in pytest.ini.

aiohttp.BasicAuth is intentionally kept because it is still required for proxy authentication, including HTTPS proxy connections. The warning is suppressed only during pytest runs rather than changing the application code.

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would change existing behavior)
  • Documentation update
  • Refactor / code cleanup
  • Other:

Checklist

  • I have tested my changes locally
  • If this affects shared logic (extraction, download engine), I also
    applied the equivalent change to moon_cli.py
  • I have kept the single-file architecture (no package split)
  • I have not added new dependencies without justification in the PR
    description

Screenshots / logs (if applicable)

Tests:

  • uv run pytest tests/ — 50 passed
  • act -j no-chrome — passed
  • act -j ruff — passed

Closes #151

@LeyckerS LeyckerS left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

This is exactly what #151 asked for, and it gets the part right that the issue was actually about.

Verified both "Done when" criteria locally rather than reading the diff:

The target warning is gone. pytest tests/ -q → 50 passed, with no warnings summary at all; it previously ended 50 passed, 1 warning.

An unrelated deprecation still shows. I added a throwaway test raising a different DeprecationWarning:

tests/test_zz_warn.py::test_other_deprecation_still_visible
  DeprecationWarning: a completely unrelated deprecation
1 passed, 1 warning

Still reported. That is the difference between this and a blanket ignore::DeprecationWarning, and it is the whole reason the issue was written the way it was — matching on the message text rather than the category is what keeps the next real deprecation visible.

The comment is right too, and it is the actual deliverable here. proxy_auth rejects anything that is not a BasicAuth, and moving the credentials into a header breaks HTTPS proxies specifically, because aiohttp authenticates those on the CONNECT request rather than inside the tunnel. Someone will find that suppression in a year and "fix it properly"; your three lines are what stops them. Pointing at #151 means the full reasoning is one click away.

moon_download.py untouched, as required.

One thing I noticed that is not yours to fix and that I am not asking for: neither workflow watches pytest.ini, so a future change to this file will not trigger CI at all. #151 said nothing about path filters and I am not moving the goalposts after the fact — opening it separately.

Merging. Welcome, and thank you for reading the issue closely enough to keep the narrow match.

@LeyckerS
LeyckerS merged commit 73c9641 into LeyckerS:main Aug 12, 2026
LeyckerS added a commit that referenced this pull request Aug 12, 2026
@XEDAB's #162 closes #160 and @Divesh-Kshirsagar's #161 closes #151.

The comment added by #162 was a single 228-character line against the
line-length of 100 in ruff.toml; wrapped here as promised in the review
rather than sending it back. Wording unchanged, plus a pointer to #160.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
LeyckerS added a commit that referenced this pull request Aug 12, 2026
Every entry in this release came from an outside contributor.

- #150 (@shard872, #116) a full disk aborts the run instead of retrying
- #149 (@Allen58562, #65) Stop interrupts transfers already in flight
- #153 (@AdvaitVarhade, #32) structured CLI exit codes
- #161 (@Divesh-Kshirsagar, #151) pytest.ini with a narrow warning filter
- #158 (@nightcityblade, #81) ruff runs once, not once per Python version
- #157 (@XEDAB, #155) the assertion that could not fail
- #162 (@XEDAB, #160) the stub that left the engine on the real network
- #159 (@AashishGupta2007, #145) the generated-era THEME block

README: consolidated the changelog sections, refreshed the stale test count,
and replaced the stars badge with a contributors badge.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.

silence the aiohttp BasicAuth deprecation warning in the test run (the call itself has to stay)

3 participants