summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorAlex Waygood <Alex.Waygood@Gmail.com>2023-08-04 19:41:04 (GMT)
committerGitHub <noreply@github.com>2023-08-04 19:41:04 (GMT)
commit2c25bd82f46df72c89ca5bca10eaa06137ab8290 (patch)
treeea4c93a5d96ab652772f7eababf5684377d10ffc /Lib
parent904b5319b3cc72063f4bfcd7beb3a1ef0fc641be (diff)
downloadcpython-2c25bd82f46df72c89ca5bca10eaa06137ab8290.zip
cpython-2c25bd82f46df72c89ca5bca10eaa06137ab8290.tar.gz
cpython-2c25bd82f46df72c89ca5bca10eaa06137ab8290.tar.bz2
gh-106368: Argument clinic: improve coverage for `self.valid_line()` calls (#107641)
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_clinic.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/Lib/test/test_clinic.py b/Lib/test/test_clinic.py
index dd17d02..84b6a19 100644
--- a/Lib/test/test_clinic.py
+++ b/Lib/test/test_clinic.py
@@ -1057,6 +1057,38 @@ class ClinicParserTest(TestCase):
Okay, we're done here.
""")
+ def test_docstring_with_comments(self):
+ function = self.parse_function(dedent("""
+ module foo
+ foo.bar
+ x: int
+ # We're about to have
+ # the documentation for x.
+ Documentation for x.
+ # We've just had
+ # the documentation for x.
+ y: int
+
+ # We're about to have
+ # the documentation for foo.
+ This is the documentation for foo.
+ # We've just had
+ # the documentation for foo.
+
+ Okay, we're done here.
+ """))
+ self.checkDocstring(function, """
+ bar($module, /, x, y)
+ --
+
+ This is the documentation for foo.
+
+ x
+ Documentation for x.
+
+ Okay, we're done here.
+ """)
+
def test_parser_regression_special_character_in_parameter_column_of_docstring_first_line(self):
function = self.parse_function(dedent("""
module os