diff --git a/573.patch b/573.patch new file mode 100644 index 0000000..60d90b9 --- /dev/null +++ b/573.patch @@ -0,0 +1,49 @@ +From 46c9caf733ea16f272ad2f131de9e78e2280d0ca Mon Sep 17 00:00:00 2001 +From: Lumir Balhar +Date: Wed, 9 Aug 2023 11:55:53 +0200 +Subject: [PATCH] Fix compatibility with pytest 7.4.0 + +Fixes: https://github.com/html5lib/html5lib-python/issues/572 +--- + html5lib/tests/tokenizer.py | 8 +++++++- + html5lib/tests/tree_construction.py | 8 +++++++- + 2 files changed, 14 insertions(+), 2 deletions(-) + +diff --git a/html5lib/tests/tokenizer.py b/html5lib/tests/tokenizer.py +index cc9897a4..8c4b1629 100644 +--- a/html5lib/tests/tokenizer.py ++++ b/html5lib/tests/tokenizer.py +@@ -246,7 +246,13 @@ def runtest(self): + def repr_failure(self, excinfo): + traceback = excinfo.traceback + ntraceback = traceback.cut(path=__file__) +- excinfo.traceback = ntraceback.filter() ++ ++ if pytest.version_tuple >= (7, 4, 0): ++ filter_args = (excinfo,) ++ else: ++ filter_args = () ++ ++ excinfo.traceback = ntraceback.filter(*filter_args) + + return excinfo.getrepr(funcargs=True, + showlocals=False, +diff --git a/html5lib/tests/tree_construction.py b/html5lib/tests/tree_construction.py +index fb0657bf..c7c91bec 100644 +--- a/html5lib/tests/tree_construction.py ++++ b/html5lib/tests/tree_construction.py +@@ -135,7 +135,13 @@ def runtest(self): + def repr_failure(self, excinfo): + traceback = excinfo.traceback + ntraceback = traceback.cut(path=__file__) +- excinfo.traceback = ntraceback.filter() ++ ++ if pytest.version_tuple >= (7, 4, 0): ++ filter_args = (excinfo,) ++ else: ++ filter_args = () ++ ++ excinfo.traceback = ntraceback.filter(*filter_args) + + return excinfo.getrepr(funcargs=True, + showlocals=False, diff --git a/python-html5lib.spec b/python-html5lib.spec index 3412b52..efa9a0e 100644 --- a/python-html5lib.spec +++ b/python-html5lib.spec @@ -9,6 +9,8 @@ Source: %{pypi_source html5lib} # Fix compatibility with pytest 6 Patch: %{url}/pull/506.patch +# Fix compatibility with pytest 7.4.0 +Patch: %{url}/pull/573.patch BuildArch: noarch