diff options
Diffstat (limited to 'dev-python/sybil/files/sybil-6.0.2-pytest-8.patch')
-rw-r--r-- | dev-python/sybil/files/sybil-6.0.2-pytest-8.patch | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/dev-python/sybil/files/sybil-6.0.2-pytest-8.patch b/dev-python/sybil/files/sybil-6.0.2-pytest-8.patch new file mode 100644 index 000000000000..2447289c0266 --- /dev/null +++ b/dev-python/sybil/files/sybil-6.0.2-pytest-8.patch @@ -0,0 +1,40 @@ +From d7428b4cfe5f817037030d025028bf09fd7992ee Mon Sep 17 00:00:00 2001 +From: Adam Dangoor <adamdangoor@gmail.com> +Date: Mon, 29 Jan 2024 11:29:16 +0000 +Subject: [PATCH] Add fixes for Pytest 8.0.0 + +--- + CHANGELOG.rst | 5 +++++ + sybil/integration/pytest.py | 17 +++++++++++++---- + 2 files changed, 18 insertions(+), 4 deletions(-) + +diff --git a/sybil/integration/pytest.py b/sybil/integration/pytest.py +index 8ce6c72..cad311d 100644 +--- a/sybil/integration/pytest.py ++++ b/sybil/integration/pytest.py +@@ -53,12 +53,21 @@ def __init__(self, parent, sybil, example: Example) -> None: + def request_fixtures(self, names): + # pytest fixtures dance: + fm = self.session._fixturemanager +- closure = fm.getfixtureclosure(names, self) +- initialnames, names_closure, arg2fixturedefs = closure +- fixtureinfo = FuncFixtureInfo(names, initialnames, names_closure, arg2fixturedefs) ++ if PYTEST_VERSION >= (8, 0, 0): ++ closure = fm.getfixtureclosure(initialnames=names, parentnode=self, ignore_args=set()) ++ names_closure, arg2fixturedefs = closure ++ fixtureinfo = FuncFixtureInfo(argnames=names, initialnames=names, names_closure=names_closure, name2fixturedefs=arg2fixturedefs) ++ else: ++ closure = fm.getfixtureclosure(names, self) ++ initialnames, names_closure, arg2fixturedefs = closure ++ fixtureinfo = FuncFixtureInfo(names, initialnames, names_closure, arg2fixturedefs) + self._fixtureinfo = fixtureinfo + self.funcargs = {} +- self._request = fixtures.FixtureRequest(self, _ispytest=True) ++ if PYTEST_VERSION >= (8, 0, 0): ++ self._request = fixtures.TopRequest(pyfuncitem=self, _ispytest=True) ++ self.fixturenames = names_closure ++ else: ++ self._request = fixtures.FixtureRequest(self, _ispytest=True) + + def reportinfo(self) -> Tuple[Union["os.PathLike[str]", str], Optional[int], str]: + info = '%s line=%i column=%i' % ( |