Skip to content

Commit

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

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

Expand Down

0 comments on commit a546ca3

Please sign in to comment.