diff --git a/IPython/core/tests/test_prefilter.py b/IPython/core/tests/test_prefilter.py index 9b7161d..3575a98 100644 --- a/IPython/core/tests/test_prefilter.py +++ b/IPython/core/tests/test_prefilter.py @@ -53,7 +53,16 @@ def test_autocall_binops(): def test_issue114(): """Check that multiline string literals don't expand as magic see http://github.com/ipython/ipython/issues/#issue/114""" + template = '"""\n%s\n"""' - for mgk in ip.lsmagic(): - raw = template % mgk - yield nt.assert_equals(ip.prefilter(raw), raw) + # Store the current value of multi_line_specials and turn it off before + # running test, since it could be true (case in which the test doesn't make + # sense, as multiline string literals *will* expand as magic in that case). + msp = ip.prefilter_manager.multi_line_specials + ip.prefilter_manager.multi_line_specials = False + try: + for mgk in ip.lsmagic(): + raw = template % mgk + yield nt.assert_equals(ip.prefilter(raw), raw) + finally: + ip.prefilter_manager.multi_line_specials = msp