Skip to content

prevent redundant test execution#35

Merged
dyollb merged 6 commits intomainfrom
fix_overlapping_marker
Mar 4, 2026
Merged

prevent redundant test execution#35
dyollb merged 6 commits intomainfrom
fix_overlapping_marker

Conversation

@dyollb
Copy link
Owner

@dyollb dyollb commented Feb 20, 2026

fixes #33

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes issue #33 by preventing redundant test execution when both module-level (pytestmark) and function-level (@pytest.mark.isolated) markers are applied to the same test. The fix introduces logic to detect function-level markers and prioritize them over inherited module/class markers for test grouping.

Changes:

  • Added marker precedence logic to prevent duplicate test runs when overlapping markers are present
  • Added comprehensive tests to verify correct behavior with overlapping markers and proper failure reporting
  • Bumped version to 0.4.4 to reflect the bug fix

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/pytest_isolated/grouping.py Added _has_own_isolated_marker() helper and logic to prioritize function-level markers when determining test grouping
tests/test_grouping.py Added two tests: one verifying failure output is correctly associated with failing tests, and another validating that overlapping markers don't cause duplicate test runs
src/pytest_isolated/__init__.py Version bump from 0.4.3 to 0.4.4

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dyollb dyollb changed the title fix issue 33 prevent redundant test execution Mar 3, 2026
@dyollb dyollb requested a review from pcrespov March 3, 2026 10:12
Copy link
Collaborator

@pcrespov pcrespov left a comment

Choose a reason for hiding this comment

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

thx! This solves the issue. Left some thoughts.

@dyollb dyollb merged commit 37a83e3 into main Mar 4, 2026
3 checks passed
@dyollb dyollb deleted the fix_overlapping_marker branch March 4, 2026 16:08
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.

Redundant and Inconsistent Use of isolated Markers in Tests

3 participants