2020-12-12 13:13:22 +01:00
|
|
|
---
|
|
|
|
pkg_resources/tests/test_markers.py | 2 +-
|
|
|
|
pkg_resources/tests/test_pkg_resources.py | 5 +----
|
|
|
|
setuptools/tests/__init__.py | 4 ++++
|
|
|
|
setuptools/tests/test_build_clib.py | 2 +-
|
|
|
|
setuptools/tests/test_easy_install.py | 2 +-
|
|
|
|
setuptools/tests/test_msvc.py | 2 +-
|
|
|
|
setuptools/tests/test_packageindex.py | 2 +-
|
|
|
|
setuptools/tests/test_register.py | 5 +----
|
|
|
|
setuptools/tests/test_test.py | 2 +-
|
|
|
|
setuptools/tests/test_upload.py | 5 +----
|
|
|
|
10 files changed, 13 insertions(+), 18 deletions(-)
|
|
|
|
|
2021-06-26 10:43:14 +02:00
|
|
|
Index: setuptools-57.0.0/pkg_resources/tests/test_markers.py
|
|
|
|
===================================================================
|
|
|
|
--- setuptools-57.0.0.orig/pkg_resources/tests/test_markers.py
|
|
|
|
+++ setuptools-57.0.0/pkg_resources/tests/test_markers.py
|
2020-12-12 13:13:22 +01:00
|
|
|
@@ -1,4 +1,4 @@
|
|
|
|
-import mock
|
|
|
|
+from . import mock
|
|
|
|
|
|
|
|
from pkg_resources import evaluate_marker
|
|
|
|
|
2021-06-26 10:43:14 +02:00
|
|
|
Index: setuptools-57.0.0/pkg_resources/tests/test_pkg_resources.py
|
|
|
|
===================================================================
|
|
|
|
--- setuptools-57.0.0.orig/pkg_resources/tests/test_pkg_resources.py
|
|
|
|
+++ setuptools-57.0.0/pkg_resources/tests/test_pkg_resources.py
|
|
|
|
@@ -9,10 +9,7 @@ import stat
|
2020-12-12 13:13:22 +01:00
|
|
|
import distutils.dist
|
|
|
|
import distutils.command.install_egg_info
|
|
|
|
|
|
|
|
-try:
|
|
|
|
- from unittest import mock
|
|
|
|
-except ImportError:
|
|
|
|
- import mock
|
|
|
|
+from . import mock
|
|
|
|
|
2021-06-26 10:43:14 +02:00
|
|
|
from pkg_resources import (
|
|
|
|
DistInfoDistribution, Distribution, EggInfoDistribution,
|
|
|
|
Index: setuptools-57.0.0/setuptools/tests/__init__.py
|
|
|
|
===================================================================
|
|
|
|
--- setuptools-57.0.0.orig/setuptools/tests/__init__.py
|
|
|
|
+++ setuptools-57.0.0/setuptools/tests/__init__.py
|
|
|
|
@@ -5,6 +5,10 @@ import pytest
|
2020-12-12 13:13:22 +01:00
|
|
|
|
2021-06-26 10:43:14 +02:00
|
|
|
__all__ = ['fail_on_ascii', 'ack_2to3']
|
2020-12-12 13:13:22 +01:00
|
|
|
|
|
|
|
+try:
|
|
|
|
+ import mock
|
|
|
|
+except ImportError:
|
|
|
|
+ from unittest import mock
|
|
|
|
|
2021-06-26 10:43:14 +02:00
|
|
|
is_ascii = locale.getpreferredencoding() == 'ANSI_X3.4-1968'
|
|
|
|
fail_on_ascii = pytest.mark.xfail(is_ascii, reason="Test fails in this locale")
|
|
|
|
Index: setuptools-57.0.0/setuptools/tests/test_build_clib.py
|
|
|
|
===================================================================
|
|
|
|
--- setuptools-57.0.0.orig/setuptools/tests/test_build_clib.py
|
|
|
|
+++ setuptools-57.0.0/setuptools/tests/test_build_clib.py
|
2020-12-12 13:13:22 +01:00
|
|
|
@@ -1,6 +1,6 @@
|
|
|
|
import pytest
|
|
|
|
|
|
|
|
-import mock
|
|
|
|
+from . import mock
|
|
|
|
from distutils.errors import DistutilsSetupError
|
|
|
|
from setuptools.command.build_clib import build_clib
|
|
|
|
from setuptools.dist import Distribution
|
2021-06-26 10:43:14 +02:00
|
|
|
Index: setuptools-57.0.0/setuptools/tests/test_easy_install.py
|
|
|
|
===================================================================
|
|
|
|
--- setuptools-57.0.0.orig/setuptools/tests/test_easy_install.py
|
|
|
|
+++ setuptools-57.0.0/setuptools/tests/test_easy_install.py
|
|
|
|
@@ -12,7 +12,7 @@ import itertools
|
2020-12-12 13:13:22 +01:00
|
|
|
import distutils.errors
|
|
|
|
import io
|
|
|
|
import zipfile
|
|
|
|
-import mock
|
|
|
|
+from . import mock
|
|
|
|
import time
|
2021-06-26 10:43:14 +02:00
|
|
|
import re
|
|
|
|
import subprocess
|
|
|
|
Index: setuptools-57.0.0/setuptools/tests/test_msvc.py
|
|
|
|
===================================================================
|
|
|
|
--- setuptools-57.0.0.orig/setuptools/tests/test_msvc.py
|
|
|
|
+++ setuptools-57.0.0/setuptools/tests/test_msvc.py
|
2020-12-12 13:13:22 +01:00
|
|
|
@@ -5,7 +5,7 @@ Tests for msvc support module.
|
|
|
|
import os
|
|
|
|
import contextlib
|
|
|
|
import distutils.errors
|
|
|
|
-import mock
|
|
|
|
+from . import mock
|
|
|
|
|
|
|
|
import pytest
|
|
|
|
|
2021-06-26 10:43:14 +02:00
|
|
|
Index: setuptools-57.0.0/setuptools/tests/test_packageindex.py
|
|
|
|
===================================================================
|
|
|
|
--- setuptools-57.0.0.orig/setuptools/tests/test_packageindex.py
|
|
|
|
+++ setuptools-57.0.0/setuptools/tests/test_packageindex.py
|
|
|
|
@@ -6,7 +6,7 @@ import urllib.request
|
|
|
|
import urllib.error
|
|
|
|
import http.client
|
2020-12-12 13:13:22 +01:00
|
|
|
|
|
|
|
-import mock
|
|
|
|
+from . import mock
|
|
|
|
import pytest
|
|
|
|
|
2021-06-26 10:43:14 +02:00
|
|
|
import setuptools.package_index
|
|
|
|
Index: setuptools-57.0.0/setuptools/tests/test_register.py
|
|
|
|
===================================================================
|
|
|
|
--- setuptools-57.0.0.orig/setuptools/tests/test_register.py
|
|
|
|
+++ setuptools-57.0.0/setuptools/tests/test_register.py
|
2020-12-12 13:13:22 +01:00
|
|
|
@@ -2,10 +2,7 @@ from setuptools.command.register import
|
|
|
|
from setuptools.dist import Distribution
|
|
|
|
from setuptools.errors import RemovedCommandError
|
|
|
|
|
|
|
|
-try:
|
|
|
|
- from unittest import mock
|
|
|
|
-except ImportError:
|
|
|
|
- import mock
|
|
|
|
+from . import mock
|
|
|
|
|
|
|
|
import pytest
|
|
|
|
|
2021-06-26 10:43:14 +02:00
|
|
|
Index: setuptools-57.0.0/setuptools/tests/test_test.py
|
|
|
|
===================================================================
|
|
|
|
--- setuptools-57.0.0.orig/setuptools/tests/test_test.py
|
|
|
|
+++ setuptools-57.0.0/setuptools/tests/test_test.py
|
|
|
|
@@ -1,4 +1,4 @@
|
2020-12-12 13:13:22 +01:00
|
|
|
-import mock
|
|
|
|
+from . import mock
|
|
|
|
from distutils import log
|
|
|
|
import os
|
|
|
|
|
2021-06-26 10:43:14 +02:00
|
|
|
Index: setuptools-57.0.0/setuptools/tests/test_upload.py
|
|
|
|
===================================================================
|
|
|
|
--- setuptools-57.0.0.orig/setuptools/tests/test_upload.py
|
|
|
|
+++ setuptools-57.0.0/setuptools/tests/test_upload.py
|
2020-12-12 13:13:22 +01:00
|
|
|
@@ -2,10 +2,7 @@ from setuptools.command.upload import up
|
|
|
|
from setuptools.dist import Distribution
|
|
|
|
from setuptools.errors import RemovedCommandError
|
|
|
|
|
|
|
|
-try:
|
|
|
|
- from unittest import mock
|
|
|
|
-except ImportError:
|
|
|
|
- import mock
|
|
|
|
+from . import mock
|
|
|
|
|
|
|
|
import pytest
|
|
|
|
|
2021-06-26 10:43:14 +02:00
|
|
|
Index: setuptools-57.0.0/setuptools/tests/test_config.py
|
|
|
|
===================================================================
|
|
|
|
--- setuptools-57.0.0.orig/setuptools/tests/test_config.py
|
|
|
|
+++ setuptools-57.0.0/setuptools/tests/test_config.py
|
|
|
|
@@ -7,7 +7,7 @@ import configparser
|
2020-12-12 13:13:22 +01:00
|
|
|
import pytest
|
|
|
|
|
|
|
|
from distutils.errors import DistutilsOptionError, DistutilsFileError
|
|
|
|
-from mock import patch
|
|
|
|
+from setuptools.tests import mock
|
|
|
|
from setuptools.dist import Distribution, _Distribution
|
|
|
|
from setuptools.config import ConfigHandler, read_configuration
|
2021-06-26 10:43:14 +02:00
|
|
|
from distutils.core import Command
|
|
|
|
@@ -974,7 +974,7 @@ class TestExternalSetters:
|
2020-12-12 13:13:22 +01:00
|
|
|
})
|
|
|
|
return None
|
|
|
|
|
|
|
|
- @patch.object(_Distribution, '__init__', autospec=True)
|
|
|
|
+ @mock.patch.object(_Distribution, '__init__', autospec=True)
|
2021-06-26 10:43:14 +02:00
|
|
|
def test_external_setters(self, mock_parent_init, tmpdir):
|
2020-12-12 13:13:22 +01:00
|
|
|
mock_parent_init.side_effect = self._fake_distribution_init
|
|
|
|
|
2021-06-26 10:43:14 +02:00
|
|
|
Index: setuptools-57.0.0/pkg_resources/tests/__init__.py
|
|
|
|
===================================================================
|
2020-12-12 13:13:22 +01:00
|
|
|
--- /dev/null
|
2021-06-26 10:43:14 +02:00
|
|
|
+++ setuptools-57.0.0/pkg_resources/tests/__init__.py
|
2020-12-12 13:13:22 +01:00
|
|
|
@@ -0,0 +1,4 @@
|
|
|
|
+try:
|
|
|
|
+ import mock
|
|
|
|
+except ImportError:
|
|
|
|
+ from unittest import mock
|