diff options
author | Paul Ganssle <pganssle@users.noreply.github.com> | 2018-10-29 12:41:50 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-29 12:41:50 -0400 |
commit | 566f3aadfa112b8d6b9a1ecf5178552f6e0f8c6c (patch) | |
tree | 661aa631695a78bb6011888cf49edf0b60b7dbd4 /setuptools/tests | |
parent | 29f9cb087fd107f412e2a2f0df877e3b14a75be9 (diff) | |
parent | 3a9dc2b03ef313ee7729606fb56ae9b41066dfd1 (diff) | |
download | external_python_setuptools-566f3aadfa112b8d6b9a1ecf5178552f6e0f8c6c.tar.gz external_python_setuptools-566f3aadfa112b8d6b9a1ecf5178552f6e0f8c6c.tar.bz2 external_python_setuptools-566f3aadfa112b8d6b9a1ecf5178552f6e0f8c6c.zip |
Merge pull request #1545 from robinjhuang/custom-deprecation-warnings
Custom deprecation warning classes.
Diffstat (limited to 'setuptools/tests')
-rw-r--r-- | setuptools/tests/test_dist.py | 5 | ||||
-rw-r--r-- | setuptools/tests/test_easy_install.py | 18 | ||||
-rw-r--r-- | setuptools/tests/test_egg_info.py | 5 |
3 files changed, 25 insertions, 3 deletions
diff --git a/setuptools/tests/test_dist.py b/setuptools/tests/test_dist.py index 5162e1c9..223ad90c 100644 --- a/setuptools/tests/test_dist.py +++ b/setuptools/tests/test_dist.py @@ -3,7 +3,7 @@ from __future__ import unicode_literals import io - +from setuptools.dist import DistDeprecationWarning, _get_unpatched from setuptools import Distribution from setuptools.extern.six.moves.urllib.request import pathname2url from setuptools.extern.six.moves.urllib_parse import urljoin @@ -56,6 +56,9 @@ def test_dist_fetch_build_egg(tmpdir): assert [dist.key for dist in resolved_dists if dist] == reqs +def test_dist__get_unpatched_deprecated(): + pytest.warns(DistDeprecationWarning, _get_unpatched, [""]) + def __maintainer_test_cases(): attrs = {"name": "package", "version": "1.0", diff --git a/setuptools/tests/test_easy_install.py b/setuptools/tests/test_easy_install.py index b0cc4c9f..2cf65ae7 100644 --- a/setuptools/tests/test_easy_install.py +++ b/setuptools/tests/test_easy_install.py @@ -15,7 +15,7 @@ import distutils.errors import io import zipfile import mock - +from setuptools.command.easy_install import EasyInstallDeprecationWarning, ScriptWriter, WindowsScriptWriter import time from setuptools.extern import six from setuptools.extern.six.moves import urllib @@ -288,6 +288,22 @@ class TestEasyInstallTest: assert (target / 'mypkg_script').exists() + def test_dist_get_script_args_deprecated(self): + with pytest.warns(EasyInstallDeprecationWarning): + ScriptWriter.get_script_args(None, None) + + def test_dist_get_script_header_deprecated(self): + with pytest.warns(EasyInstallDeprecationWarning): + ScriptWriter.get_script_header("") + + def test_dist_get_writer_deprecated(self): + with pytest.warns(EasyInstallDeprecationWarning): + ScriptWriter.get_writer(None) + + def test_dist_WindowsScriptWriter_get_writer_deprecated(self): + with pytest.warns(EasyInstallDeprecationWarning): + WindowsScriptWriter.get_writer() + @pytest.mark.filterwarnings('ignore:Unbuilt egg') class TestPTHFileWriter: def test_add_from_cwd_site_sets_dirty(self): diff --git a/setuptools/tests/test_egg_info.py b/setuptools/tests/test_egg_info.py index 59ffb16d..46fb884f 100644 --- a/setuptools/tests/test_egg_info.py +++ b/setuptools/tests/test_egg_info.py @@ -7,7 +7,7 @@ import re import stat import time -from setuptools.command.egg_info import egg_info, manifest_maker +from setuptools.command.egg_info import egg_info, manifest_maker, EggInfoDeprecationWarning, get_pkg_info_revision from setuptools.dist import Distribution from setuptools.extern.six.moves import map @@ -603,3 +603,6 @@ class TestEggInfo: with open(os.path.join(egg_info_dir, 'PKG-INFO')) as pkginfo_file: pkg_info_lines = pkginfo_file.read().split('\n') assert 'Version: 0.0.0.dev0' in pkg_info_lines + + def test_get_pkg_info_revision_deprecated(self): + pytest.warns(EggInfoDeprecationWarning, get_pkg_info_revision)
\ No newline at end of file |