Skip to content

Commit 475f6be

Browse files
authored
Fix API breakage with pytest 9.1.0 (#22)
* Fix API breakage with pytest 9.1.0 The ndiff value matches the previous default. * Add pytest 9 to test matrix
1 parent 5c2d4a8 commit 475f6be

3 files changed

Lines changed: 7 additions & 1 deletion

File tree

.github/workflows/test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ jobs:
3131
pytest-version:
3232
- "pytest<8"
3333
- "pytest<9"
34+
- "pytest<10"
3435
- "pytest"
3536
- "git+https://github.com/pytest-dev/pytest.git@main"
3637
exclude:

pytest_unordered/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,16 @@ def pytest_assertrepr_compare(
114114
_compare_eq_any(extra_left[0], extra_right[0], verbose=verbose), # type: ignore[call-arg]
115115
)
116116
else:
117+
args = {}
118+
if pytest.version_tuple >= (9, 1, 0):
119+
args = {"assertion_text_diff_style": "ndiff"}
117120
result.extend(
118121
_compare_eq_any(
119122
extra_left[0],
120123
extra_right[0],
121124
highlighter=config.get_terminal_writer()._highlight, # noqa: SLF001
122125
verbose=verbose,
126+
**args,
123127
),
124128
)
125129
else:

tox.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[tox]
22
envlist =
33
{py38,py39}-{pytest7,pytest8},
4-
{py310,py311,py312,py313,pypy3}-{pytest7,pytest8,pytestlatest},
4+
{py310,py311,py312,py313,pypy3}-{pytest7,pytest8,pytest9,pytestlatest},
55
prek
66

77
[testenv]
@@ -12,6 +12,7 @@ deps =
1212
codecov
1313
pytest7: pytest>=7.4.4,<8
1414
pytest8: pytest>=8.1.1,<9
15+
pytest9: pytest>=9.1,<10
1516
pytestlatest: pytest
1617

1718
[testenv:prek]

0 commit comments

Comments
 (0)