summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_pyrepl/test_interact.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_pyrepl/test_interact.py')
-rw-r--r--Lib/test/test_pyrepl/test_interact.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_pyrepl/test_interact.py b/Lib/test/test_pyrepl/test_interact.py
index 10e3404..6ebd51f 100644
--- a/Lib/test/test_pyrepl/test_interact.py
+++ b/Lib/test/test_pyrepl/test_interact.py
@@ -94,3 +94,12 @@ class TestSimpleInteract(unittest.TestCase):
with patch.object(console, "showsyntaxerror") as mock_showsyntaxerror:
console.runsource(source)
mock_showsyntaxerror.assert_called_once()
+
+ def test_no_active_future(self):
+ console = InteractiveColoredConsole()
+ source = "x: int = 1; print(__annotations__)"
+ f = io.StringIO()
+ with contextlib.redirect_stdout(f):
+ result = console.runsource(source)
+ self.assertFalse(result)
+ self.assertEqual(f.getvalue(), "{'x': <class 'int'>}\n")