summaryrefslogtreecommitdiff
path: root/Lib/idlelib/idle_test/test_warning.py
diff options
context:
space:
mode:
authorTerry Jan Reedy <tjreedy@udel.edu>2015-09-09 02:10:17 -0400
committerTerry Jan Reedy <tjreedy@udel.edu>2015-09-09 02:10:17 -0400
commit78d915aa3e12300118f0f274ead583713197ead7 (patch)
tree8783676abd14479d950df5b8dace0baa7911bda2 /Lib/idlelib/idle_test/test_warning.py
parentbf19d169504823c258a9aae4bf61c8df9ff5987f (diff)
downloadcpython-git-78d915aa3e12300118f0f274ead583713197ead7.tar.gz
Issue 24199: Deprecate idlelib.idlever with a warning on import.
Diffstat (limited to 'Lib/idlelib/idle_test/test_warning.py')
-rw-r--r--Lib/idlelib/idle_test/test_warning.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/idlelib/idle_test/test_warning.py b/Lib/idlelib/idle_test/test_warning.py
index 18627ddd23..54ac993e88 100644
--- a/Lib/idlelib/idle_test/test_warning.py
+++ b/Lib/idlelib/idle_test/test_warning.py
@@ -68,6 +68,15 @@ class ShellWarnTest(unittest.TestCase):
'Test', UserWarning, 'test_warning.py', 99, f, 'Line of code')
self.assertEqual(shellmsg.splitlines(), f.getvalue().splitlines())
+class ImportWarnTest(unittest.TestCase):
+ def test_idlever(self):
+ with warnings.catch_warnings(record=True) as w:
+ warnings.simplefilter("always")
+ import idlelib.idlever
+ self.assertEqual(len(w), 1)
+ self.assertTrue(issubclass(w[-1].category, DeprecationWarning))
+ self.assertIn("version", str(w[-1].message))
+
if __name__ == '__main__':
unittest.main(verbosity=2, exit=False)