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/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: 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]