forked from pool/python-pytest-shutil
- Add patch remove-mock.patch:
* Do not use external mock. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:pytest/python-pytest-shutil?expand=0&rev=16
This commit is contained in:
53
remove-mock.patch
Normal file
53
remove-mock.patch
Normal file
@@ -0,0 +1,53 @@
|
||||
Index: pytest-shutil-1.7.0/pytest_shutil/run.py
|
||||
===================================================================
|
||||
--- pytest-shutil-1.7.0.orig/pytest_shutil/run.py
|
||||
+++ pytest-shutil-1.7.0/pytest_shutil/run.py
|
||||
@@ -11,7 +11,12 @@ import textwrap
|
||||
from contextlib import closing
|
||||
import subprocess
|
||||
|
||||
-from mock import patch
|
||||
+try:
|
||||
+ from unittest.mock import patch
|
||||
+except ImportError:
|
||||
+ # python 2
|
||||
+ from mock import patch
|
||||
+
|
||||
import execnet
|
||||
from six.moves import cPickle # @UnresolvedImport
|
||||
|
||||
Index: pytest-shutil-1.7.0/tests/integration/test_run_integration.py
|
||||
===================================================================
|
||||
--- pytest-shutil-1.7.0.orig/tests/integration/test_run_integration.py
|
||||
+++ pytest-shutil-1.7.0/tests/integration/test_run_integration.py
|
||||
@@ -8,7 +8,10 @@ import inspect
|
||||
import textwrap
|
||||
from uuid import uuid4
|
||||
|
||||
-import mock
|
||||
+try:
|
||||
+ from unittest import mock
|
||||
+except ImportError:
|
||||
+ import mock
|
||||
|
||||
from pytest_shutil import run, workspace
|
||||
from pytest_shutil.env import no_cov
|
||||
Index: pytest-shutil-1.7.0/tests/unit/test_run.py
|
||||
===================================================================
|
||||
--- pytest-shutil-1.7.0.orig/tests/unit/test_run.py
|
||||
+++ pytest-shutil-1.7.0/tests/unit/test_run.py
|
||||
@@ -3,7 +3,13 @@ from uuid import uuid4
|
||||
from subprocess import PIPE, STDOUT
|
||||
|
||||
import pytest
|
||||
-from mock import Mock, patch, sentinel, DEFAULT, call
|
||||
+
|
||||
+try:
|
||||
+ from unittest.mock import Mock, patch, sentinel, DEFAULT, call
|
||||
+except ImportError:
|
||||
+ # python 2
|
||||
+ from mock import Mock, patch, sentinel, DEFAULT, call
|
||||
+
|
||||
from six.moves import cPickle
|
||||
|
||||
from pytest_shutil import run
|
||||
Reference in New Issue
Block a user