summaryrefslogtreecommitdiff
path: root/setuptools/tests/test_sdist.py
diff options
context:
space:
mode:
authorAnderson Bravalheri <andersonbravalheri@gmail.com>2021-11-04 12:40:50 +0000
committerAnderson Bravalheri <andersonbravalheri@gmail.com>2021-11-04 13:08:16 +0000
commit9d0dc418639a0bf7cd9244feb705d30b60e1a906 (patch)
tree86719e604c9727d5e94b5614c7524123e9c55fed /setuptools/tests/test_sdist.py
parent08235e88d10179c89ed80a4dd9bf2d18c76b478d (diff)
downloadpython-setuptools-git-9d0dc418639a0bf7cd9244feb705d30b60e1a906.tar.gz
Make sure user gets warned when using distutils
Diffstat (limited to 'setuptools/tests/test_sdist.py')
-rw-r--r--setuptools/tests/test_sdist.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/setuptools/tests/test_sdist.py b/setuptools/tests/test_sdist.py
index 4ab13228..e6d8e908 100644
--- a/setuptools/tests/test_sdist.py
+++ b/setuptools/tests/test_sdist.py
@@ -148,7 +148,8 @@ class TestSdistTest:
self.assert_package_data_in_manifest(cmd)
- def test_custom_build_py(self):
+ @mock.patch('setuptools.command.egg_info.log')
+ def test_custom_build_py(self, log_stub):
"""
Ensure projects defining custom build_py don't break
when creating sdists (issue #2849)
@@ -185,6 +186,19 @@ class TestSdistTest:
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'