diff options
| author | Terry Jan Reedy <tjreedy@udel.edu> | 2015-09-09 06:10:10 (GMT) |
|---|---|---|
| committer | Terry Jan Reedy <tjreedy@udel.edu> | 2015-09-09 06:10:10 (GMT) |
| commit | e1d38b08b042850787f69a15e687cf3cc279740d (patch) | |
| tree | 0f93d10aef22455ddaf367d5d7708285cb3176bd /Lib/idlelib/idle_test/test_warning.py | |
| parent | 672237e8874adb7b6ea591d183c9e12a5a75d622 (diff) | |
| download | cpython-e1d38b08b042850787f69a15e687cf3cc279740d.zip cpython-e1d38b08b042850787f69a15e687cf3cc279740d.tar.gz cpython-e1d38b08b042850787f69a15e687cf3cc279740d.tar.bz2 | |
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.py | 9 |
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 da1d8a1..26710f1 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) |
