]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.11] gh-106368: Increase Argument Clinic test coverage for IndentStack (GH-106933...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 21 Jul 2023 06:31:00 +0000 (23:31 -0700)
committerGitHub <noreply@github.com>
Fri, 21 Jul 2023 06:31:00 +0000 (06:31 +0000)
(cherry picked from commit 8d228cf66f316803e95685d6553084f3d60cd9c5)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
Lib/test/test_clinic.py

index cef121d9a1ead3cb41288e2c421da043a95b308b..605d101b5bef90bd74746da7b8c3b940cffb0987 100644 (file)
@@ -1035,6 +1035,25 @@ class ClinicParserTest(_ParserBase):
                 Nested docstring here, goeth.
         """)
 
+    def test_indent_stack_no_tabs(self):
+        out = self.parse_function_should_fail("""
+            module foo
+            foo.bar
+               *vararg1: object
+            \t*vararg2: object
+        """)
+        msg = "Tab characters are illegal in the Clinic DSL."
+        self.assertIn(msg, out)
+
+    def test_indent_stack_illegal_outdent(self):
+        out = self.parse_function_should_fail("""
+            module foo
+            foo.bar
+              a: object
+             b: object
+        """)
+        self.assertIn("Illegal outdent", out)
+
     def test_directive(self):
         c = FakeClinic()
         parser = DSLParser(c)