Skip to content

fixtures: remove a no longer needed sort#12019

Merged
bluetech merged 3 commits into
pytest-dev:mainfrom
bluetech:fixtures-simplify
Feb 22, 2024
Merged

fixtures: remove a no longer needed sort#12019
bluetech merged 3 commits into
pytest-dev:mainfrom
bluetech:fixtures-simplify

Conversation

@bluetech
Copy link
Copy Markdown
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
Copy Markdown
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