From c705ac72c00413686632e540f50f46e39d072ecc5b6eeae98adee0f1d33be2ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Fri, 1 Nov 2019 09:32:16 +0000 Subject: [PATCH] - Add patch to work with new pytest: * pytest4.patch OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-CacheControl?expand=0&rev=14 --- pytest4.patch | 41 +++++++++++++++++++++++++++++++++++++ python-CacheControl.changes | 6 ++++++ python-CacheControl.spec | 4 +++- 3 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 pytest4.patch diff --git a/pytest4.patch b/pytest4.patch new file mode 100644 index 0000000..b25a975 --- /dev/null +++ b/pytest4.patch @@ -0,0 +1,41 @@ +From 2b886af2a3d0271bf5598ba3917e39395bb8f4b5 Mon Sep 17 00:00:00 2001 +From: TheJokr +Date: Fri, 25 Jan 2019 21:53:53 +0100 +Subject: [PATCH] Removed cherrypy.server from pytest namespace + +pytest_namespace was removed in pytest version 4.0. +The fixture now points directly to cherrypy.server. +--- + tests/conftest.py | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/tests/conftest.py b/tests/conftest.py +index f9701cf..c581c0d 100644 +--- a/tests/conftest.py ++++ b/tests/conftest.py +@@ -107,7 +107,7 @@ def __call__(self, env, start_response): + + @pytest.fixture(scope="session") + def server(): +- return pytest.server ++ return cherrypy.server + + + @pytest.fixture() +@@ -124,7 +124,7 @@ def get_free_port(): + return ip, port + + +-def pytest_namespace(): ++def pytest_configure(config): + cherrypy.tree.graft(SimpleApp(), "/") + + ip, port = get_free_port() +@@ -136,7 +136,6 @@ def pytest_namespace(): + logger.removeHandler(logger.handlers[0]) + + cherrypy.server.start() +- return {"server": cherrypy.server} + + + def pytest_unconfigure(config): diff --git a/python-CacheControl.changes b/python-CacheControl.changes index 59a0d8b..a13b2b1 100644 --- a/python-CacheControl.changes +++ b/python-CacheControl.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Nov 1 09:31:12 UTC 2019 - Tomáš Chvátal + +- Add patch to work with new pytest: + * pytest4.patch + ------------------------------------------------------------------- Wed Sep 18 09:15:22 UTC 2019 - Tomáš Chvátal diff --git a/python-CacheControl.spec b/python-CacheControl.spec index e4e5f37..ac3c2b8 100644 --- a/python-CacheControl.spec +++ b/python-CacheControl.spec @@ -25,6 +25,7 @@ License: Apache-2.0 Group: Development/Languages/Python URL: https://github.com/ionrock/cachecontrol Source: https://github.com/ionrock/cachecontrol/archive/v0.12.5.tar.gz#/CacheControl-%{version}.tar.gz +Patch0: pytest4.patch BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros @@ -39,7 +40,7 @@ BuildRequires: python3-CherryPy BuildRequires: python3-lockfile >= 0.9 BuildRequires: python3-mock BuildRequires: python3-msgpack -BuildRequires: python3-pytest < 4 +BuildRequires: python3-pytest BuildRequires: python3-redis >= 2.10.5 BuildRequires: python3-requests # /SECTION @@ -51,6 +52,7 @@ requests session object. %prep %setup -q -n cachecontrol-%{version} +%patch0 -p1 %build %python_build