Install & Compatibility
Where this runs
tested against v0.8.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.444s · 31.1MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 2.8s · import 0.410s · 32MB
30MB installed
● package 30MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
unordered
✓ from pytest_unordered import unordered
unordered_list
✓ from pytest_unordered import unordered_list
Use for explicit list matching introduced in 0.5.0
unordered_set
✓ from pytest_unordered import unordered_set
Use for explicit set matching introduced in 0.5.0
unordered_dict
✓ from pytest_unordered import unordered_dict
Use for explicit dict matching introduced in 0.5.0
This quickstart demonstrates how to use the `unordered()` matcher within pytest to assert equality of lists and dictionaries where the order of elements or keys does not matter. Save this as a Python file (e.g., `test_order.py`) and run `pytest`.
import pytest
from pytest_unordered import unordered
def test_list_order_agnostic_equality():
actual_list = [1, 3, 2]
expected_list = [2, 1, 3]
assert actual_list == unordered(expected_list)
def test_dict_order_agnostic_equality():
actual_dict = {'a': 1, 'b': 2}
expected_dict = {'b': 2, 'a': 1}
assert actual_dict == unordered(expected_dict)
Errors
Common errors & fixes
NameError: name 'unordered' is not defined
The 'unordered' matcher was used in a test without being explicitly imported from the pytest_unordered module.
fixfrom pytest_unordered import unordered
ModuleNotFoundError: No module named 'pytest_unordered'
The 'pytest-unordered' package is not installed in the current Python environment, or there's a typo in the import statement.
fixpip install pytest-unordered
TypeError: unordered() missing 1 required positional argument: 'iterable'
The 'unordered()' matcher was called without providing the expected collection (an iterable) as its required argument.
fixassert actual_list == unordered([1, 2, 3])
Upgrade
Version history
0.8.0latest on PyPI · released Jun 16, 2026
Audit
Dependencies
pytestrequiredThis package is a pytest plugin and requires pytest to function.