From 0a26b6b23007c2f89ba859b579771a97c0087ccf Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Mon, 15 Jun 2026 16:02:41 +0200 Subject: [PATCH 1/2] Fix API breakage with pytest 9.1.0 The ndiff value matches the previous default. --- pytest_unordered/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pytest_unordered/__init__.py b/pytest_unordered/__init__.py index 86bdd65..881fd67 100644 --- a/pytest_unordered/__init__.py +++ b/pytest_unordered/__init__.py @@ -114,12 +114,16 @@ def pytest_assertrepr_compare( _compare_eq_any(extra_left[0], extra_right[0], verbose=verbose), # type: ignore[call-arg] ) else: + args = {} + if pytest.version_tuple >= (9, 1, 0): + args = {"assertion_text_diff_style": "ndiff"} result.extend( _compare_eq_any( extra_left[0], extra_right[0], highlighter=config.get_terminal_writer()._highlight, # noqa: SLF001 verbose=verbose, + **args, ), ) else: From 7fb5750672db56e13e442729783d733b024a4177 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Mon, 15 Jun 2026 16:37:51 +0200 Subject: [PATCH 2/2] Add pytest 9 to test matrix --- .github/workflows/test.yml | 1 + tox.ini | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7a745d0..1874972 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,6 +31,7 @@ jobs: pytest-version: - "pytest<8" - "pytest<9" + - "pytest<10" - "pytest" - "git+https://github.com/pytest-dev/pytest.git@main" exclude: diff --git a/tox.ini b/tox.ini index 68e462e..ac66305 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] envlist = {py38,py39}-{pytest7,pytest8}, - {py310,py311,py312,py313,pypy3}-{pytest7,pytest8,pytestlatest}, + {py310,py311,py312,py313,pypy3}-{pytest7,pytest8,pytest9,pytestlatest}, prek [testenv] @@ -12,6 +12,7 @@ deps = codecov pytest7: pytest>=7.4.4,<8 pytest8: pytest>=8.1.1,<9 + pytest9: pytest>=9.1,<10 pytestlatest: pytest [testenv:prek]