Skip to content

warn if pdb option is passed on isolated tests#36

Merged
dyollb merged 3 commits intomainfrom
fix_issue34
Mar 3, 2026
Merged

warn if pdb option is passed on isolated tests#36
dyollb merged 3 commits intomainfrom
fix_issue34

Conversation

@dyollb
Copy link
Owner

@dyollb dyollb commented Feb 21, 2026

fixes #34

  • If user provides --pdb, the isolation will automatically be disabled and pytest will warn the user to use --no-isolation. Using --no-isolation --pdb should not trigger the warning.

  • I could not reproduce the --ff issue

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 addresses issue #34 by automatically disabling isolation when the --pdb flag is used, since the debugger cannot work in subprocesses. The implementation adds a helpful warning that suggests using --no-isolation --pdb explicitly to avoid the warning in the future.

Changes:

  • Adds automatic detection of --pdb flag that disables isolation and warns users
  • Respects explicit --no-isolation flag to avoid showing redundant warnings
  • Adds comprehensive test coverage for the new warning behavior and verifies --ff (failed-first) works with isolated tests

Reviewed changes

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

File Description
src/pytest_isolated/grouping.py Adds --pdb detection logic that automatically disables isolation and emits a warning when isolated tests are present
src/pytest_isolated/config.py Documents that --pdb is not forwarded to subprocesses and isolation is automatically disabled when detected
tests/test_options.py Adds three new tests: one for --pdb with warning, one for --no-isolation --pdb without warning, and one for --ff functionality

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

@dyollb dyollb requested a review from pcrespov February 21, 2026 12:03
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.

Some thoughts ...

@dyollb dyollb requested a review from pcrespov March 3, 2026 07:22
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!

@dyollb dyollb merged commit 5256011 into main Mar 3, 2026
3 checks passed
@dyollb dyollb deleted the fix_issue34 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.

pytest --pdb and --ff do not work with @pytest.mark.isolated tests`

3 participants