Skip to content

Commit

Permalink
pytest_ver = pytest.getattr("version_tuple", ())
Browse files Browse the repository at this point in the history
  • Loading branch information
cclauss committed Jan 9, 2024
1 parent d30e69a commit 6bcbf1c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion html5lib/tests/tokenizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,8 @@ def runtest(self):
def repr_failure(self, excinfo):
traceback = excinfo.traceback
ntraceback = traceback.cut(path=__file__)
filter_args = (excinfo,) if pytest.version_tuple >= (7, 4, 0) else ()
pytest_ver = pytest.getattr("version_tuple", ())
filter_args = (excinfo,) if pytest_ver >= (7, 4, 0) else ()
excinfo.traceback = ntraceback.filter(*filter_args)

return excinfo.getrepr(funcargs=True,
Expand Down
3 changes: 2 additions & 1 deletion html5lib/tests/tree_construction.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ def runtest(self):
def repr_failure(self, excinfo):
traceback = excinfo.traceback
ntraceback = traceback.cut(path=__file__)
filter_args = (excinfo,) if pytest.version_tuple >= (7, 4, 0) else ()
pytest_ver = pytest.getattr("version_tuple", ())
filter_args = (excinfo,) if pytest_ver >= (7, 4, 0) else ()
excinfo.traceback = ntraceback.filter(*filter_args)

return excinfo.getrepr(funcargs=True,
Expand Down

0 comments on commit 6bcbf1c

Please sign in to comment.