From ca99656e7953c34e05f302cc0a9c52a50640b36731888feccd02a5a90ea3c87b Mon Sep 17 00:00:00 2001 From: Daniel Garcia Date: Tue, 3 Oct 2023 07:10:47 +0000 Subject: [PATCH] - Add fix-tests-hookimpls.patch to fix tests with latest pytest in Factory. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-virtualenv?expand=0&rev=138 --- fix-tests-hookimpls.patch | 13 +++++++++++++ python-virtualenv.changes | 6 ++++++ python-virtualenv.spec | 2 ++ 3 files changed, 21 insertions(+) create mode 100644 fix-tests-hookimpls.patch diff --git a/fix-tests-hookimpls.patch b/fix-tests-hookimpls.patch new file mode 100644 index 0000000..0b278d4 --- /dev/null +++ b/fix-tests-hookimpls.patch @@ -0,0 +1,13 @@ +Index: virtualenv-20.24.5/tests/conftest.py +=================================================================== +--- virtualenv-20.24.5.orig/tests/conftest.py ++++ virtualenv-20.24.5/tests/conftest.py +@@ -25,7 +25,7 @@ def pytest_configure(config): + """Ensure randomly is called before we re-order""" + manager = config.pluginmanager + +- order = manager.hook.pytest_collection_modifyitems._hookimpls # noqa: SLF001 ++ order = manager.hook.pytest_collection_modifyitems.get_hookimpls() # noqa: SLF001 + dest = next((i for i, p in enumerate(order) if p.plugin is manager.getplugin("randomly")), None) + if dest is not None: + from_pos = next(i for i, p in enumerate(order) if p.plugin is manager.getplugin(__file__)) diff --git a/python-virtualenv.changes b/python-virtualenv.changes index 201be6d..5189ce7 100644 --- a/python-virtualenv.changes +++ b/python-virtualenv.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Oct 3 07:10:17 UTC 2023 - Daniel Garcia + +- Add fix-tests-hookimpls.patch to fix tests with latest pytest in + Factory. + ------------------------------------------------------------------- Tue Oct 3 06:39:58 UTC 2023 - Daniel Garcia diff --git a/python-virtualenv.spec b/python-virtualenv.spec index 682dd69..2ab9da9 100644 --- a/python-virtualenv.spec +++ b/python-virtualenv.spec @@ -34,6 +34,8 @@ Summary: Virtual Python Environment builder License: MIT URL: http://www.virtualenv.org/ Source: https://files.pythonhosted.org/packages/source/v/virtualenv/virtualenv-%{version}.tar.gz +# PATCH-FIX-OPENSUSE fix-tests-hookimpls.patch +Patch1: fix-tests-hookimpls.patch BuildRequires: %{python_module distlib >= 0.3.7} BuildRequires: %{python_module filelock >= 3.12.2} BuildRequires: %{python_module hatch-vcs >= 0.3}