Skip to content

fixtures: remove a no longer needed sort #12019

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 22, 2024

Conversation

bluetech
Copy link
Member

First 2 commits are simple code cleanups, the 3rd commit is described below. I saw it when looking into #12008 but it's unrelated to it.


Dicts these days preserve order, so the sort is no longer needed to achieve determinism.

As shown by the test_dynamic_parametrized_ordering test, this can change the ordering of items, but only in equivalent ways (same number of setups/teardowns per scope), it will just respect the user's given ordering better (hence vxlan items now ordered before vlan items compared to the previous ordering).

Dicts these days preserve order, so the sort is no longer needed to
achieve determinism.

As shown by the `test_dynamic_parametrized_ordering` test, this can
change the ordering of items, but only in equivalent ways (same number
of setups/teardowns per scope), it will just respect the user's given
ordering better (hence `vxlan` items now ordered before `vlan` items
compared to the previous ordering).
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.

Nice!

@bluetech bluetech merged commit 691d8fc into pytest-dev:main Feb 22, 2024
@bluetech bluetech deleted the fixtures-simplify branch February 22, 2024 19:52
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