forked from pool/python-pytest-server-fixtures
- do not require six - use -p1 as quilt does not like higher - modified patches % pytest-plugins-pr186-fix-psycopg29.patch (refreshed) % remove-mock.patch (refreshed) - added patches fix https://github.com/man-group/pytest-plugins/issues/209 + python-pytest-server-fixtures-no-six.patch OBS-URL: https://build.opensuse.org/request/show/1041392 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:pytest/python-pytest-server-fixtures?expand=0&rev=14
74 lines
2.5 KiB
Diff
74 lines
2.5 KiB
Diff
Index: a/tests/integration/test_xvfb_server.py
|
|
===================================================================
|
|
--- a/tests/integration/test_xvfb_server.py
|
|
+++ b/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/tests/unit/serverclass/test_docker_unit.py
|
|
===================================================================
|
|
--- a/tests/unit/serverclass/test_docker_unit.py
|
|
+++ b/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/tests/unit/serverclass/test_thread_unit.py
|
|
===================================================================
|
|
--- a/tests/unit/serverclass/test_thread_unit.py
|
|
+++ b/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/tests/unit/test_server_unit.py
|
|
===================================================================
|
|
--- a/tests/unit/test_server_unit.py
|
|
+++ b/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: tests/unit/test_server_v2_unit.py
|
|
===================================================================
|
|
--- a/tests/unit/test_server_v2_unit.py
|
|
+++ b/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?
|
|
|