Mixin for abstract test classes #8612
Labels
type: docs
documentation improvement, missing or needing clarification
type: proposal
proposal for a new feature, often to gather opinions or design the API around the new feature
What's the problem this feature will solve?
Abstract test classes that use __test__=False to avoid collection require that the subclasses set __test__=True to be collected. If a user forgets to reset the attribute, the test they thought was running will be silently ignored. Difficult to catch in large projects.
Describe the solution you'd like
Have subclasses collected by pytest regardless of superclass attribute. I use a mixin class to achieve this:
Mixin clearly indicates what's not a test. No need to unset on subclasses. Safe to mixin on subclasses if they are also abstract. What I'm really asking is, would you like to add this mixin class to pytest.__init__?
Alternative Solutions
Additional context
No
The text was updated successfully, but these errors were encountered: