summaryrefslogtreecommitdiff
path: root/setuptools/tests/test_easy_install.py
diff options
context:
space:
mode:
authorrobinjhuang <robin.j.huang@gmail.com>2018-10-27 18:46:55 -0400
committerPaul Ganssle <paul@ganssle.io>2018-10-28 17:45:42 -0400
commit3a9dc2b03ef313ee7729606fb56ae9b41066dfd1 (patch)
tree661aa631695a78bb6011888cf49edf0b60b7dbd4 /setuptools/tests/test_easy_install.py
parent9d63059f112c80d0419bac71596c79cd4660398d (diff)
downloadpython-setuptools-git-3a9dc2b03ef313ee7729606fb56ae9b41066dfd1.tar.gz
Add unit tests for setuptools deprecation warnings
These are tests to ensure that the specified deprecation warnings are raised when the functions are called. Co-authored-by: Junhan Huang <robin.j.huang@gmail.com> Co-authored-by: Marton Pono <marci93@gmail.com>
Diffstat (limited to 'setuptools/tests/test_easy_install.py')
-rw-r--r--setuptools/tests/test_easy_install.py18
1 files changed, 17 insertions, 1 deletions
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):