From a4980283bcca551b373f936ef4fa7aed6edc1729 2015-05-27 18:09:26 From: Matthias Bussonnier Date: 2015-05-27 18:09:26 Subject: [PATCH] Add test that interactive warning is shown. --- diff --git a/IPython/core/tests/test_interactiveshell.py b/IPython/core/tests/test_interactiveshell.py index ddb86f7..f6a9b71 100644 --- a/IPython/core/tests/test_interactiveshell.py +++ b/IPython/core/tests/test_interactiveshell.py @@ -901,3 +901,20 @@ def test_warning_suppression(): ip.run_cell("warnings.warn('asdf')") finally: ip.run_cell("del warnings") + + +def test_deprecation_warning(): + ip.run_cell(""" +import warnings +def wrn(): + warnings.warn( + "I AM A WARNING", + DeprecationWarning + ) + """) + try: + with tt.AssertPrints("I AM A WARNING", channel="stderr"): + ip.run_cell("wrn()") + finally: + ip.run_cell("del warnings") + ip.run_cell("del wrn")