]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-111201: Use a more common constant in completion tests in test_pyrepl (#118638)
authorPablo Galindo Salgado <Pablogsal@gmail.com>
Mon, 6 May 2024 10:56:47 +0000 (11:56 +0100)
committerGitHub <noreply@github.com>
Mon, 6 May 2024 10:56:47 +0000 (10:56 +0000)
Lib/test/test_pyrepl.py

index 3cba37c70e95574151b08df5212bdf6c1b3a7c02..2b217abdf1543b4514912a58247d3ef4f610fb9d 100644 (file)
@@ -578,13 +578,18 @@ class TestPyReplCompleter(TestCase):
         self.assertEqual(output, "os.getenv")
 
     def test_completion_with_many_options(self):
-        events = code_to_events("os.\t\tO_AS\t\n")
+        # Test with something that initially displays many options
+        # and then complete from one of them. The first time tab is
+        # pressed, the options are displayed (which corresponds to
+        # when the repl shows [ not unique ]) and the second completes
+        # from one of them.
+        events = code_to_events("os.\t\tO_AP\t\n")
 
         namespace = {"os": os}
         reader = self.prepare_reader(events, namespace)
 
         output = multiline_input(reader, namespace)
-        self.assertEqual(output, "os.O_ASYNC")
+        self.assertEqual(output, "os.O_APPEND")
 
     def test_empty_namespace_completion(self):
         events = code_to_events("os.geten\t\n")