summaryrefslogtreecommitdiff
path: root/setuptools/tests/test_sdist.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2021-11-07 04:48:16 -0500
committerGitHub <noreply@github.com>2021-11-07 04:48:16 -0500
commitdec4d0b3edd20614dced9c5c9203e755a4f9addd (patch)
tree4325d0bc6d2814160920c893bb39c83e8633b1be /setuptools/tests/test_sdist.py
parent7a1411ffc1cce75cc5251071154ff53f3fd0444d (diff)
parent4a979b6f38415d8841f650234dff301ed63658e7 (diff)
downloadpython-setuptools-git-dec4d0b3edd20614dced9c5c9203e755a4f9addd.tar.gz
Merge pull request #2857 from abravalheri/deprecated-distutils-command
Deprecate support for commands inheriting from distutils
Diffstat (limited to 'setuptools/tests/test_sdist.py')
-rw-r--r--setuptools/tests/test_sdist.py20
1 files changed, 4 insertions, 16 deletions
diff --git a/setuptools/tests/test_sdist.py b/setuptools/tests/test_sdist.py
index e6d8e908..66f46ad0 100644
--- a/setuptools/tests/test_sdist.py
+++ b/setuptools/tests/test_sdist.py
@@ -11,6 +11,7 @@ from unittest import mock
import pytest
import pkg_resources
+from setuptools import SetuptoolsDeprecationWarning
from setuptools.command.sdist import sdist
from setuptools.command.egg_info import manifest_maker
from setuptools.dist import Distribution
@@ -148,8 +149,7 @@ class TestSdistTest:
self.assert_package_data_in_manifest(cmd)
- @mock.patch('setuptools.command.egg_info.log')
- def test_custom_build_py(self, log_stub):
+ def test_custom_build_py(self):
"""
Ensure projects defining custom build_py don't break
when creating sdists (issue #2849)
@@ -180,25 +180,13 @@ class TestSdistTest:
cmd.distribution.cmdclass = {'build_py': CustomBuildPy}
assert cmd.distribution.get_command_class('build_py') == CustomBuildPy
- with quiet():
+ msg = "setuptools instead of distutils"
+ with quiet(), pytest.warns(SetuptoolsDeprecationWarning, match=msg):
cmd.run()
using_custom_command_guard.assert_called()
self.assert_package_data_in_manifest(cmd)
- warn_stub = log_stub.warn
- warn_stub.assert_called()
- for call in warn_stub.call_args_list:
- args, _kw = call
- if "setuptools instead of distutils" in args[0]:
- return
- else:
- raise AssertionError(
- "The user should have been warned to extend setuptools command"
- " classes instead of distutils",
- warn_stub.call_args_list
- )
-
def test_setup_py_exists(self):
dist = Distribution(SETUP_ATTRS)
dist.script_name = 'foo.py'