Skip to content

tests: fix pytest warnings - #7099

Merged
snejus merged 5 commits into
masterfrom
fix-pytest-warnings
Oct 22, 2026
Merged

snejus merged 5 commits into
masterfrom
fix-pytest-warnings

Conversation

@snejus

@snejus snejus commented Oct 12, 2026

Copy link
Copy Markdown
Member

Depends on: #7093

Summary

Clears out the warnings the test suite emits under Python 3.14, so the output is readable again and real warnings stand out.

  • codecs.open removed (beetsplug/edit.py:429, beetsplug/export.py:210) - deprecated since 3.11, plain open() with encoding= is the drop-in replacement. Same in test/plugins/test_edit.py.
  • Class-scoped fixtures declared as @classmethod across 8 test modules - pytest warns when a scope="class" fixture is defined as an instance method, since there is no per-test instance to bind to. self.X references become cls.X.
  • test_bpd.py fork handling - 3.14 defaults to forkserver on Linux, but the BPD server subprocess needs to inherit the parent's patched gstplayer and mock state, so the start method is now forced to fork unconditionally. Under pytest-xdist the parent is multi-threaded, which 3.14 warns about; ignored at module level with a comment explaining why it's safe here.
  • Warnings we can't fix are ignored narrowly - asyncio policy deprecations pinned in setup.cfg, pathlib.PurePath.as_uri() on the one test_thumbnails.py test that exercises it, and legacy string-field deprecations in test/autotag/test_hooks.py where the deprecated fields are the thing under test.

@snejus
snejus requested a review from a team as a code owner October 12, 2026 13:07
Copilot AI balanced review requested due to automatic review settings October 12, 2026 13:07
@github-actions

Copy link
Copy Markdown

Thank you for the PR! The changelog has not been updated, so here is a friendly reminder to check if you need to add an entry.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@codecov

codecov Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.69%. Comparing base (b7ebf6d) to head (3f619e0).
⚠️ Report is 3 commits behind head on master.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7099      +/-   ##
==========================================
+ Coverage   80.49%   80.69%   +0.20%     
==========================================
  Files         149      149              
  Lines       21243    21241       -2     
  Branches     3281     3281              
==========================================
+ Hits        17099    17140      +41     
+ Misses       3315     3274      -41     
+ Partials      829      827       -2     
Files with missing lines Coverage Δ
beetsplug/edit.py 78.26% <100.00%> (-0.08%) ⬇️
beetsplug/export.py 88.59% <ø> (-0.10%) ⬇️

... and 4 files with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@snejus
snejus force-pushed the drop-python-310-support branch from 35035ff to 722d865 Compare October 20, 2026 06:14
@snejus
snejus requested a review from asardaes as a code owner October 20, 2026 06:14
@snejus
snejus force-pushed the fix-pytest-warnings branch from 1d00530 to 5dfab0b Compare October 20, 2026 06:14
@snejus
snejus force-pushed the drop-python-310-support branch from 722d865 to e507549 Compare October 21, 2026 17:47
@snejus
snejus force-pushed the fix-pytest-warnings branch from 5dfab0b to 413c6e0 Compare October 21, 2026 17:48
@snejus
snejus force-pushed the drop-python-310-support branch from e507549 to b7ebf6d Compare October 21, 2026 18:03
@snejus
snejus force-pushed the fix-pytest-warnings branch from 413c6e0 to e768c87 Compare October 21, 2026 18:03
Base automatically changed from drop-python-310-support to master October 21, 2026 18:55
@snejus
snejus force-pushed the fix-pytest-warnings branch from 90e696c to 3f619e0 Compare October 22, 2026 07:22
@snejus
snejus merged commit 50f6d62 into master Oct 22, 2026
30 of 31 checks passed
@snejus
snejus deleted the fix-pytest-warnings branch October 22, 2026 11:56
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.

2 participants