Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[alt] Refactor DSLParser.format_docstring() #18

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions Lib/test/test_clinic.py
Original file line number Diff line number Diff line change
Expand Up @@ -868,8 +868,8 @@ def expect_failure(self, block, err, *, filename=None, lineno=None):

def checkDocstring(self, fn, expected):
self.assertTrue(hasattr(fn, "docstring"))
self.assertEqual(fn.docstring.strip(),
dedent(expected).strip())
self.assertEqual(dedent(expected).strip(),
fn.docstring.strip())

def test_trivial(self):
parser = DSLParser(FakeClinic())
Expand Down Expand Up @@ -998,8 +998,12 @@ def test_function_docstring(self):

path: str
Path to be examined
Ensure that multiple lines are indented correctly.

Perform a stat system call on the given path.

Ensure that multiple lines are indented correctly.
Ensure that multiple lines are indented correctly.
""")
self.checkDocstring(function, """
stat($module, /, path)
Expand All @@ -1009,6 +1013,10 @@ def test_function_docstring(self):

path
Path to be examined
Ensure that multiple lines are indented correctly.

Ensure that multiple lines are indented correctly.
Ensure that multiple lines are indented correctly.
""")

def test_docstring_trailing_whitespace(self):
Expand Down
Loading
Loading