Skip to content

Reject negative --order-scope-level values - #284

Merged
mrbean-bremen merged 2 commits into
pytest-dev:mainfrom
mk78:mk78-fix-pytest-order-small-bug
Dec 4, 2026
Merged

mrbean-bremen merged 2 commits into
pytest-dev:mainfrom
mk78:mk78-fix-pytest-order-small-bug

Conversation

@mk78

@mk78 mk78 commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Reject negative values for --order-scope-level during argument parsing.

Previously, negative values were accepted and interpreted through Python slicing, resulting in unintended directory scope behavior.

The option now produces a clear pytest usage error for negative values while preserving valid non-negative levels.

Tests

  • Focused scope-level tests: passed
  • Full suite: 180 passed
  • Pre-commit checks: passed

Fixes the negative scope-level validation defect.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@mrbean-bremen
mrbean-bremen force-pushed the mk78-fix-pytest-order-small-bug branch from a0bab78 to a70b85a Compare December 3, 2026 18:27

@mrbean-bremen mrbean-bremen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please add a short entry to the release notes.

@codecov-commenter

codecov-commenter commented Dec 3, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.71%. Comparing base (72b14a6) to head (d3b57c9).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #284      +/-   ##
==========================================
- Coverage   98.09%   97.71%   -0.38%     
==========================================
  Files           5        6       +1     
  Lines         681      787     +106     
  Branches      144      168      +24     
==========================================
+ Hits          668      769     +101     
- Misses          4        8       +4     
- Partials        9       10       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@mk78

mk78 commented Dec 3, 2026

Copy link
Copy Markdown
Contributor Author

Added a short entry to the Unreleased release notes. Thanks!

@mrbean-bremen mrbean-bremen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@mrbean-bremen
mrbean-bremen merged commit 118ad42 into pytest-dev:main Dec 4, 2026
18 checks passed
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.

3 participants