Skip to content

Implement --fail-all-on-failed-ordering#246

Merged
mrbean-bremen merged 1 commit into
pytest-dev:mainfrom
victor-nexthop:feature.fail-on-ordering
Jun 12, 2026
Merged

Implement --fail-all-on-failed-ordering#246
mrbean-bremen merged 1 commit into
pytest-dev:mainfrom
victor-nexthop:feature.fail-on-ordering

Conversation

@victor-nexthop

@victor-nexthop victor-nexthop commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

One more PR!

I want my tests to not even attempt running if there is an ordering problem, and to test ordering with --collect-only.

(vibed).

@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 again! Only one small remark.

Comment thread src/pytest_order/item.py Outdated
import sys
from typing import Optional, Generic, TypeVar

from _pytest.config.exceptions import UsageError

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.

This can be directly imported from pytest (same for Function below).

Comment thread src/pytest_order/sorter.py Outdated
from warnings import warn

from _pytest.config import Config
from _pytest.config.exceptions import UsageError

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.

see above, may also fix the following imports (avoiding private imports)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Pushed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

...rebased and pushed again.

@victor-nexthop victor-nexthop Jun 12, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ugh, looks like one can only import Config from pytest on Python 3.14 - by the the look of the CI.
Experimenting...

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.

Hm, this seems to be supported only from pytest 7 onward. Maybe it's time to kill support for pytest 6... It does not support Python 3.14 anyway, that's why this version is not tested there. But that is for a later version, I think, so we should keep the private imports for now, sorry for the wrong assumption.

@victor-nexthop victor-nexthop force-pushed the feature.fail-on-ordering branch 5 times, most recently from 28bb611 to 50ba45d Compare June 12, 2026 18:34
@victor-nexthop victor-nexthop force-pushed the feature.fail-on-ordering branch from 50ba45d to ccd568a Compare June 12, 2026 18:38
@mrbean-bremen mrbean-bremen merged commit 43e0769 into pytest-dev:main Jun 12, 2026
16 checks passed
@victor-nexthop

Copy link
Copy Markdown
Contributor Author

Thanks for merging! Looking forward to next release :)

@mrbean-bremen

Copy link
Copy Markdown
Member

The release is out.

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.

2 participants