Skip to content

Commit 46c9caf

Browse files
committed
Fix compatibility with pytest 7.4.0
Fixes: html5lib#572
1 parent 3e500bb commit 46c9caf

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

html5lib/tests/tokenizer.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,13 @@ def runtest(self):
246246
def repr_failure(self, excinfo):
247247
traceback = excinfo.traceback
248248
ntraceback = traceback.cut(path=__file__)
249-
excinfo.traceback = ntraceback.filter()
249+
250+
if pytest.version_tuple >= (7, 4, 0):
251+
filter_args = (excinfo,)
252+
else:
253+
filter_args = ()
254+
255+
excinfo.traceback = ntraceback.filter(*filter_args)
250256

251257
return excinfo.getrepr(funcargs=True,
252258
showlocals=False,

html5lib/tests/tree_construction.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,13 @@ def runtest(self):
135135
def repr_failure(self, excinfo):
136136
traceback = excinfo.traceback
137137
ntraceback = traceback.cut(path=__file__)
138-
excinfo.traceback = ntraceback.filter()
138+
139+
if pytest.version_tuple >= (7, 4, 0):
140+
filter_args = (excinfo,)
141+
else:
142+
filter_args = ()
143+
144+
excinfo.traceback = ntraceback.filter(*filter_args)
139145

140146
return excinfo.getrepr(funcargs=True,
141147
showlocals=False,

0 commit comments

Comments
 (0)