Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 13, 2025

Pytest 8.4+ no longer allows pytest_plugins in non-top-level conftest files. This was causing test collection to fail with:

Defining 'pytest_plugins' in a non-top-level conftest is no longer supported:
It affects the entire test suite instead of just below the conftest as expected.
  /home/runner/work/readthedocs.org/readthedocs.org/readthedocs/conftest.py

Changes

  • Created /conftest.py with the pytest_plugins = ("sphinx.testing.fixtures",) declaration
  • Removed pytest_plugins from readthedocs/conftest.py, preserving all fixtures

All 2459 tests now collect and run successfully.

Original prompt

Move pytest_plugins to top-level conftest.py for pytest compatibility

This PR moves the pytest_plugins assignment from readthedocs/conftest.py to a new top-level conftest.py file, as required by recent pytest versions. This resolves the error:

Defining 'pytest_plugins' in a non-top-level conftest is no longer supported

Now, all tests can be collected and run as expected with modern pytest.

No functional changes to tests or fixtures; this is a compatibility fix only.

Created from VS Code via the GitHub Pull Request extension.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Move pytest_plugins to top-level conftest.py for compatibility Move pytest_plugins to top-level conftest.py for pytest 8.4+ compatibility Nov 13, 2025
Copilot AI requested a review from ericholscher November 13, 2025 19:42
Copilot finished work on behalf of ericholscher November 13, 2025 19:42
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