54 lines
1.6 KiB
Diff
54 lines
1.6 KiB
Diff
|
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
|