diff --git a/python-pytest-server-fixtures.changes b/python-pytest-server-fixtures.changes index 0d48525..a1cdf1a 100644 --- a/python-pytest-server-fixtures.changes +++ b/python-pytest-server-fixtures.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Apr 21 20:21:33 UTC 2022 - Ben Greiner + +- Add remove-mock.patch because mock WAS required and is not pulled + in anymore by something else -- gh#man-group/pytest-plugins#171 + ------------------------------------------------------------------- Mon Mar 21 04:29:05 UTC 2022 - Steve Kowalik diff --git a/python-pytest-server-fixtures.spec b/python-pytest-server-fixtures.spec index b55f749..6f64c40 100644 --- a/python-pytest-server-fixtures.spec +++ b/python-pytest-server-fixtures.spec @@ -17,16 +17,19 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} +%bcond_without python2 Name: python-pytest-server-fixtures Version: 1.7.0 Release: 0 -Summary: Extensible server fixures for py.test +Summary: Extensible server fixtures for pytest License: MIT Group: Development/Languages/Python URL: https://github.com/man-group/pytest-plugins Source: https://files.pythonhosted.org/packages/source/p/pytest-server-fixtures/pytest-server-fixtures-%{version}.tar.gz # PATCH-FIX-UPSTREAM pytest-plugins-pr186-fix-psycopg29.patch -- gh#man-group/pytest-plugins#186 Patch0: https://github.com/man-group/pytest-plugins/pull/186.patch#/pytest-plugins-pr186-fix-psycopg29.patch +# PATCH-FEATURE-UPSTREAM remove-mock.patch -- gh#man-group#pytest-plugins#171 +Patch1: remove-mock.patch BuildRequires: %{python_module setuptools-git} BuildRequires: %{python_module setuptools} BuildRequires: fdupes @@ -75,6 +78,9 @@ BuildRequires: %{python_module requests} BuildRequires: %{python_module rethinkdb} BuildRequires: %{python_module retry} BuildRequires: %{python_module six} +%if %{with python2} +BuildRequires: python2-mock +%endif BuildRequires: apache2 BuildRequires: lsof BuildRequires: net-tools-deprecated @@ -87,7 +93,7 @@ BuildRequires: xorg-x11-server %python_subpackages %description -Extensible server fixures for py.test. +Extensible server fixtures for pytest %prep %autosetup -p2 -n pytest-server-fixtures-%{version} @@ -120,6 +126,7 @@ export SERVER_FIXTURES_REDIS=%{_sbindir}/redis-server %files %{python_files} %doc CHANGES.md README.md %license LICENSE -%{python_sitelib}/* +%{python_sitelib}/pytest_server_fixtures +%{python_sitelib}/pytest_server_fixtures-%{version}*-info %changelog diff --git a/remove-mock.patch b/remove-mock.patch new file mode 100644 index 0000000..1a00749 --- /dev/null +++ b/remove-mock.patch @@ -0,0 +1,73 @@ +Index: a/pytest-server-fixtures-1.7.0/tests/integration/test_xvfb_server.py +=================================================================== +--- a/pytest-server-fixtures-1.7.0/tests/integration/test_xvfb_server.py ++++ b/pytest-server-fixtures-1.7.0/tests/integration/test_xvfb_server.py +@@ -4,7 +4,11 @@ import time + + from itertools import chain, repeat + +-from mock import patch ++try: ++ from unittest.mock import patch ++except ImportError: ++ from mock import patch ++ + import pytest + from pytest import raises + +Index: a/pytest-server-fixtures-1.7.0/tests/unit/serverclass/test_docker_unit.py +=================================================================== +--- a/pytest-server-fixtures-1.7.0/tests/unit/serverclass/test_docker_unit.py ++++ b/pytest-server-fixtures-1.7.0/tests/unit/serverclass/test_docker_unit.py +@@ -1,4 +1,8 @@ +-from mock import sentinel, patch, Mock ++try: ++ from unittest.mock import sentinel, patch, Mock ++except ImportError: ++ from mock import sentinel, patch, Mock ++ + + from pytest_server_fixtures.serverclass.docker import DockerServer + +Index: a/pytest-server-fixtures-1.7.0/tests/unit/serverclass/test_thread_unit.py +=================================================================== +--- a/pytest-server-fixtures-1.7.0/tests/unit/serverclass/test_thread_unit.py ++++ b/pytest-server-fixtures-1.7.0/tests/unit/serverclass/test_thread_unit.py +@@ -1,4 +1,8 @@ +-from mock import sentinel, patch, Mock ++try: ++ from unittest.mock import sentinel, patch, Mock ++except ImportError: ++ from mock import sentinel, patch, Mock ++ + + from pytest_server_fixtures import CONFIG + from pytest_server_fixtures.serverclass.thread import ThreadServer +Index: a/pytest-server-fixtures-1.7.0/tests/unit/test_server_unit.py +=================================================================== +--- a/pytest-server-fixtures-1.7.0/tests/unit/test_server_unit.py ++++ b/pytest-server-fixtures-1.7.0/tests/unit/test_server_unit.py +@@ -1,4 +1,8 @@ +-from mock import create_autospec, sentinel, call, patch, Mock ++try: ++ from unittest.mock import create_autospec, sentinel, call, patch, Mock ++except ImportError: ++ from mock import create_autospec, sentinel, call, patch, Mock ++ + + from pytest_server_fixtures.base import TestServer as _TestServer # So that pytest doesnt think this is a test case + +Index: pytest-server-fixtures-1.7.0/tests/unit/test_server_v2_unit.py +=================================================================== +--- a/pytest-server-fixtures-1.7.0/tests/unit/test_server_v2_unit.py ++++ b/pytest-server-fixtures-1.7.0/tests/unit/test_server_v2_unit.py +@@ -1,4 +1,8 @@ +-from mock import create_autospec, sentinel, call, patch, Mock ++try: ++ from unittest.mock import create_autospec, sentinel, call, patch, Mock ++except ImportError: ++ from mock import create_autospec, sentinel, call, patch, Mock ++ + + from pytest_server_fixtures.base2 import TestServerV2 as _TestServerV2 # TODO: why as _TestServerV2? +