Thanks to visit codestin.com
Credit goes to github.com

Skip to content

tests: req pytest>=8.4.0, load plugins explicitly#6612

Merged
bastimeyer merged 2 commits into
streamlink:masterfrom
bastimeyer:tests/pytest-explicit-plugins
Oct 26, 2025
Merged

tests: req pytest>=8.4.0, load plugins explicitly#6612
bastimeyer merged 2 commits into
streamlink:masterfrom
bastimeyer:tests/pytest-explicit-plugins

Conversation

@bastimeyer

@bastimeyer bastimeyer commented Jul 17, 2025

Copy link
Copy Markdown
Member

Add the --disable-plugin-autoload pytest option (pytest >=8.4.0) and explicitly load pytest plugins which are required by Streamlink's test suite.

By default, pytest plugins are discovered automatically by checking all installed Python distributions in the current Python environment, which may lead to unwanted pytest plugins being loaded and executed.


Random pytest plugins shouldn't be loaded when running the test suite.

  1. Some Streamlink packagers have set incorrect test dependencies in their packages (we've removed pytest-asyncio in the past), resulting in those plugins being loaded automatically.
  2. Streamlink could be installed in an env that's not clean and where lots of other pytest plugins are installed. For example, I've been casually working on the transition from requests+urllib3 to httpx, and this causes plugins of both to be loaded by default.

Before merging, I'll need to have a look at which pytest versions are packaged in the main Linux distros where Streamlink is packaged. Pytest 8.4.0 is fairly recent, so this might be a problem.

Last checked: 2025-09-29

Add the `--disable-plugin-autoload` pytest option (pytest >=8.4.0)
and explicitly load pytest plugins which are required by
Streamlink's test suite.

By default, pytest plugins are discovered automatically by checking all
installed Python distributions in the current Python environment,
which may lead to unwanted pytest plugins being loaded and executed.
@bastimeyer bastimeyer marked this pull request as draft July 17, 2025 20:34
@bastimeyer bastimeyer marked this pull request as ready for review October 26, 2025 15:12
@bastimeyer

Copy link
Copy Markdown
Member Author

Going to merge this now after 3 months of waiting...

I'm not familiar with Fedora's release schedule, but they are still holding on to pytest 8.3.5 for some reason, probably because they consider it a big breaking change (upstream 8.4.0 lists breaking changes that should be irrelevant for almost all projects using pytest, unless neglected):

The other distros are small ones which have lots of outdated Python packages.

@bastimeyer bastimeyer merged commit ab1f365 into streamlink:master Oct 26, 2025
27 checks passed
@bastimeyer bastimeyer deleted the tests/pytest-explicit-plugins branch October 26, 2025 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant