Skip to content

Conversation

@Bubble-Interface
Copy link

@Bubble-Interface Bubble-Interface commented Nov 30, 2025

closes #13634

Summary

This PR fixes an issue where attempting to disable a conftest.py file using the -p no: option resulted in an internal assertion failure.

conftest.py files are not plugins and cannot be enabled or disabled using -p, but pytest previously accepted such arguments and crashed later during plugin loading with:

AssertionError: ... This is not supposed to happen.

Pytest now rejects attempts to block a conftest early during argument processing and raises a clear UsageError explaining that conftest files cannot be disabled via -p.

What’s Changed

  • Added explicit detection for -p no:<name> where <name> refers to a conftest file (e.g. conftest.py, or a path to a conftest).

  • Introduced an early UsageError with an actionable message.

  • Updated config test

@psf-chronographer psf-chronographer bot added the bot:chronographer:provided (automation) changelog entry is part of PR label Nov 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:chronographer:provided (automation) changelog entry is part of PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Blocked conftest loads anyway; raises "not supposed to happen"

1 participant