forked from pool/python-pytest-server-fixtures
- Add remove-mock.patch because mock WAS required and is not pulled in anymore by something else -- gh#man-group/pytest-plugins#171 OBS-URL: https://build.opensuse.org/request/show/971916 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:pytest/python-pytest-server-fixtures?expand=0&rev=12
74 lines
2.9 KiB
Diff
74 lines
2.9 KiB
Diff
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?
|
|
|