pytest2/testing/python
Ran Benita e89d23b247 fixtures: fix catastrophic performance problem in `reorder_items`
Fix #12355.

In the issue, it was reported that the `reorder_items` has quadratic (or
worse...) behavior with certain simple parametrizations. After some
debugging I found that the problem happens because the "Fix
items_by_argkey order" loop keeps adding the same item to the deque,
and it reaches epic sizes which causes the slowdown.

I don't claim to understand how the `reorder_items` algorithm works, but
if as far as I understand, if an item already exists in the deque, the
correct thing to do is to move it to the front. Since a deque doesn't
have such an (efficient) operation, this switches to `OrderedDict` which
can efficiently append from both sides, deduplicate and move to front.
2024-06-04 10:15:50 +03:00
..
approx.py Fixed Bug Regarding Attribute Error in pytest.approx For Types Implicitly Convertible to Numpy Arrays (#12232) 2024-04-23 10:45:33 +02:00
collect.py python,unittest: don't collect abstract classes 2024-05-13 13:00:47 +03:00
fixtures.py fixtures: fix catastrophic performance problem in `reorder_items` 2024-06-04 10:15:50 +03:00
integration.py Spelling and minor changes (#12122) 2024-05-15 13:49:34 -03:00
metafunc.py [pre-commit.ci] pre-commit autoupdate (#12115) 2024-03-13 15:30:18 +02:00
raises.py [flake8-bugbear] Fixes a B017 we can actually fix and noqa the two others 2024-02-04 19:27:23 +01:00
show_fixtures_per_test.py add feature to view fixture source location in invocations with --fixtures-per-test option (#8626) 2021-05-14 14:38:55 +02:00