diff options
| author | Paul Ganssle <paul@ganssle.io> | 2019-10-31 11:25:57 -0400 |
|---|---|---|
| committer | Paul Ganssle <paul@ganssle.io> | 2019-11-02 15:10:29 -0400 |
| commit | f413f95e95b34b26d9ed9d9c43b3e4b3d30caecc (patch) | |
| tree | b064d6fa23466fcfd560cc513a661d6f5e38392e /setuptools/tests/test_register.py | |
| parent | 6ac7b4ee036ef8e6954198689d214e8ee9b29118 (diff) | |
| download | python-setuptools-git-f413f95e95b34b26d9ed9d9c43b3e4b3d30caecc.tar.gz | |
Remove "upload" and "register" commands.
The upload and register commands were deprecated over a year ago, in
July 2018 (PR GH-1410, discussed in issue GH-1381). It is time to
actively remove them in favor of twine.
Diffstat (limited to 'setuptools/tests/test_register.py')
| -rw-r--r-- | setuptools/tests/test_register.py | 43 |
1 files changed, 11 insertions, 32 deletions
diff --git a/setuptools/tests/test_register.py b/setuptools/tests/test_register.py index 96114595..98605806 100644 --- a/setuptools/tests/test_register.py +++ b/setuptools/tests/test_register.py @@ -1,43 +1,22 @@ -import mock -from distutils import log - -import pytest - from setuptools.command.register import register from setuptools.dist import Distribution +from setuptools.errors import RemovedCommandError +try: + from unittest import mock +except ImportError: + import mock -class TestRegisterTest: - def test_warns_deprecation(self): - dist = Distribution() - - cmd = register(dist) - cmd.run_command = mock.Mock() - cmd.send_metadata = mock.Mock() - cmd.announce = mock.Mock() - - cmd.run() +import pytest - cmd.announce.assert_called_with( - "WARNING: Registering is deprecated, use twine to upload instead " - "(https://pypi.org/p/twine/)", - log.WARN - ) - def test_warns_deprecation_when_raising(self): +class TestRegister: + def test_register_exception(self): + """Ensure that the register command has been properly removed.""" dist = Distribution() + dist.dist_files = [(mock.Mock(), mock.Mock(), mock.Mock())] cmd = register(dist) - cmd.run_command = mock.Mock() - cmd.send_metadata = mock.Mock() - cmd.send_metadata.side_effect = Exception - cmd.announce = mock.Mock() - with pytest.raises(Exception): + with pytest.raises(RemovedCommandError): cmd.run() - - cmd.announce.assert_called_with( - "WARNING: Registering is deprecated, use twine to upload instead " - "(https://pypi.org/p/twine/)", - log.WARN - ) |
