From e730680f6b6d6f067a364d0dd5626464da42d89ed838806ab8f47f4bd8e7e598 Mon Sep 17 00:00:00 2001 From: Daniel Garcia Date: Wed, 30 Nov 2022 07:22:06 +0000 Subject: [PATCH] - Add pytest72.patch to make it compatible with pytest 7.2.0 gh#aio-libs/pytest-aiohttp#49 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:pytest/python-pytest-aiohttp?expand=0&rev=8 --- pytest72.patch | 33 +++++++++++++++++++++++++++++++++ python-pytest-aiohttp.changes | 6 ++++++ python-pytest-aiohttp.spec | 8 +++++--- 3 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 pytest72.patch diff --git a/pytest72.patch b/pytest72.patch new file mode 100644 index 0000000..513715d --- /dev/null +++ b/pytest72.patch @@ -0,0 +1,33 @@ +From d7f142e8ee73fa50096e5e9ed00458ea7e874845 Mon Sep 17 00:00:00 2001 +From: Daniel Garcia Moreno +Date: Wed, 30 Nov 2022 08:01:19 +0100 +Subject: [PATCH] Use pytest.hookimpl in pytest_configure + +pytest.PytestDeprecationWarning: The hookimpl pytest_configure uses +old-style configuration options (marks or attributes). + +Please use the pytest.hookimpl(tryfirst=True) decorator instead to +configure the hooks. +See https://docs.pytest.org/en/latest/deprecations.html#configuring-hook-specs-impls-using-markers + +Fix https://github.com/aio-libs/pytest-aiohttp/issues/47 +--- + pytest_aiohttp/plugin.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/pytest_aiohttp/plugin.py b/pytest_aiohttp/plugin.py +index d4854d8..68c8ad8 100644 +--- a/pytest_aiohttp/plugin.py ++++ b/pytest_aiohttp/plugin.py +@@ -18,7 +18,7 @@ LEGACY_MODE = DeprecationWarning( + ) + + +-@pytest.mark.tryfirst ++@pytest.hookimpl(tryfirst=True) + def pytest_configure(config) -> None: + val = config.getoption("asyncio_mode") + if val is None: +-- +2.38.1 + diff --git a/python-pytest-aiohttp.changes b/python-pytest-aiohttp.changes index 8aae744..82c7ecc 100644 --- a/python-pytest-aiohttp.changes +++ b/python-pytest-aiohttp.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Nov 30 07:21:17 UTC 2022 - Daniel Garcia + +- Add pytest72.patch to make it compatible with pytest 7.2.0 + gh#aio-libs/pytest-aiohttp#49 + ------------------------------------------------------------------- Sat Oct 15 09:17:10 UTC 2022 - Ben Greiner diff --git a/python-pytest-aiohttp.spec b/python-pytest-aiohttp.spec index 6425b7e..e2f434d 100644 --- a/python-pytest-aiohttp.spec +++ b/python-pytest-aiohttp.spec @@ -25,11 +25,13 @@ License: Apache-2.0 Group: Development/Languages/Python URL: https://github.com/aio-libs/pytest-aiohttp Source: https://files.pythonhosted.org/packages/source/p/pytest-aiohttp/pytest-aiohttp-%{version}.tar.gz +# PATCH-FIX-UPSTREAM pytest72.patch gh#aio-libs/pytest-aiohttp#49 +Patch0: pytest72.patch BuildRequires: %{python_module aiohttp >= 3.8.1} BuildRequires: %{python_module base >= 3.7} BuildRequires: %{python_module pip} BuildRequires: %{python_module pytest >= 6.1.0} -BuildRequires: %{python_module pytest-asyncio >= 0.17.2} +BuildRequires: %{python_module pytest-asyncio >= 0.20.2} BuildRequires: %{python_module setuptools_scm >= 6.2} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module wheel} @@ -37,7 +39,7 @@ BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-aiohttp >= 3.8.1 Requires: python-pytest >= 6.1.0 -Requires: python-pytest-asyncio >= 0.17.2 +Requires: python-pytest-asyncio >= 0.20.2 BuildArch: noarch %python_subpackages @@ -45,7 +47,7 @@ BuildArch: noarch A library that provides fixtures for creation test aiohttp server and client. %prep -%setup -q -n %{pyname}-%{version} +%autosetup -p1 -n %{pyname}-%{version} %build %pyproject_wheel