From 3e0dafa9bf7fbecdac33f43eb686d746ea98910d 2024-10-21 17:55:20 From: Paul Ivanov Date: 2024-10-21 17:55:20 Subject: [PATCH] test for autocall regression Without the fix in #14513, this test would fail with > assert ip.prefilter("foo") == "foo" E AssertionError: assert 'foo()' == 'foo' --- diff --git a/IPython/core/tests/test_prefilter.py b/IPython/core/tests/test_prefilter.py index 999cd43..379a530 100644 --- a/IPython/core/tests/test_prefilter.py +++ b/IPython/core/tests/test_prefilter.py @@ -137,3 +137,13 @@ def test_autocall_should_support_unicode(): finally: ip.run_line_magic("autocall", "0") del ip.user_ns["π"] + + +def test_autocall_regression_gh_14513(): + ip.run_line_magic("autocall", "2") + ip.user_ns["foo"] = dict() + try: + assert ip.prefilter("foo") == "foo" + finally: + ip.run_line_magic("autocall", "0") + del ip.user_ns["foo"]