Skip to content

Add note on using mixin classes for abstract test classes in documentation#13346

Merged
nicoddemus merged 2 commits intopytest-dev:mainfrom
BahramF73:docs-improvement-8612
Apr 7, 2025
Merged

Add note on using mixin classes for abstract test classes in documentation#13346
nicoddemus merged 2 commits intopytest-dev:mainfrom
BahramF73:docs-improvement-8612

Conversation

@BahramF73
Copy link
Contributor

Description

This PR adds a new recipe to the documentation for handling abstract test classes in pytest. The recipe demonstrates how to use a mixin class to automatically manage the test attribute for subclasses of abstract test classes. This ensures that subclasses are collected by pytest without requiring manual configuration.

Closes #8612

Checklist

  • Allow maintainers to push and squash when merging my commits.
  • Created a new changelog file: 8612.doc.rst.

@psf-chronographer psf-chronographer bot added the bot:chronographer:provided (automation) changelog entry is part of PR label Apr 3, 2025
@BahramF73 BahramF73 closed this Apr 3, 2025
@BahramF73 BahramF73 deleted the docs-improvement-8612 branch April 3, 2025 11:44
@BahramF73 BahramF73 restored the docs-improvement-8612 branch April 3, 2025 11:55
@BahramF73 BahramF73 reopened this Apr 3, 2025
Copy link
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

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

Thanks!

@nicoddemus nicoddemus merged commit 46c94ee into pytest-dev:main Apr 7, 2025
28 checks passed
@patchback
Copy link

patchback bot commented Apr 7, 2025

Backport to 8.3.x: 💚 backport PR created

✅ Backport PR branch: patchback/backports/8.3.x/46c94ee82ddbb4a541f5bd4fecd0b4071e1972ae/pr-13346

Backported as #13359

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Apr 7, 2025
nicoddemus pushed a commit that referenced this pull request Apr 7, 2025
…ation (#13346) (#13359)

(cherry picked from commit 46c94ee)

Co-authored-by: Bahram Farahmand <[email protected]>
@BahramF73 BahramF73 deleted the docs-improvement-8612 branch April 7, 2025 13:10
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.

Mixin for abstract test classes

2 participants