diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2024-05-29 01:26:19 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-29 01:26:19 (GMT) |
commit | 17d3398486dcbc6f5e977bf4c052d7780013c074 (patch) | |
tree | c8eae2e903be8bb1f71e034666756cc87567b159 /Lib/test/test_pyrepl/test_interact.py | |
parent | ef9fd10670f70c3c26bd1f9eba48cf26229f9052 (diff) | |
download | cpython-17d3398486dcbc6f5e977bf4c052d7780013c074.zip cpython-17d3398486dcbc6f5e977bf4c052d7780013c074.tar.gz cpython-17d3398486dcbc6f5e977bf4c052d7780013c074.tar.bz2 |
[3.13] gh-119443: Turn off from __future__ import annotations in REPL (GH-119493) (#119697)
gh-119443: Turn off from __future__ import annotations in REPL (GH-119493)
(cherry picked from commit a8e35e8ebad8c3bb44d14968aa05d1acbc028247)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Diffstat (limited to 'Lib/test/test_pyrepl/test_interact.py')
-rw-r--r-- | Lib/test/test_pyrepl/test_interact.py | 9 |
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") |