Skip to content

Commit cfc666f

Browse files
authored
test: add tests to ensure no regression leading to bug in issue 259 (#322)
1 parent b944680 commit cfc666f

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

tests/_data/string_files/do_format_docstrings.toml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,6 +1065,51 @@ expected='''"""
10651065
:yield: Until test complete, then run cleanup.
10661066
"""'''
10671067

1068+
[issue_259]
1069+
source = '''"""
1070+
"xxxxxxxxxxxxx".
1071+
1072+
blah.
1073+
"""'''
1074+
expected = '''""""xxxxxxxxxxxxx".
1075+
1076+
blah.
1077+
"""'''
1078+
1079+
[issue_259_black]
1080+
source = '''"""
1081+
"xxxxxxxxxxxxx".
1082+
1083+
blah.
1084+
"""'''
1085+
expected = '''""" "xxxxxxxxxxxxx".
1086+
1087+
blah.
1088+
"""'''
1089+
1090+
[issue_259_pre_summary_space]
1091+
source = '''"""
1092+
"xxxxxxxxxxxxx".
1093+
1094+
blah.
1095+
"""'''
1096+
expected = '''""" "xxxxxxxxxxxxx".
1097+
1098+
blah.
1099+
"""'''
1100+
1101+
[issue_259_pre_summary_newline]
1102+
source = '''"""
1103+
"xxxxxxxxxxxxx".
1104+
1105+
blah.
1106+
"""'''
1107+
expected = '''"""
1108+
"xxxxxxxxxxxxx".
1109+
1110+
blah.
1111+
"""'''
1112+
10681113
[issue_263_sphinx]
10691114
# the `xx.\n\n` ensures there are a summary and a description sections
10701115
# the `:param a:` creates a field

tests/formatter/test_do_format_docstring.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,10 @@
172172
("issue_263_sphinx", NO_ARGS),
173173
("issue_263_epytext", ["-s", "epytext"] + NO_ARGS),
174174
("issue_271", ["--pre-summary-newline"] + WRAP_BOTH_88),
175+
("issue_259", NO_ARGS),
176+
("issue_259_black", ["--black"] + NO_ARGS),
177+
("issue_259_pre_summary_space", ["--pre-summary-space"] + NO_ARGS),
178+
("issue_259_pre_summary_newline", ["--pre-summary-newline"] + NO_ARGS),
175179
],
176180
)
177181
def test_do_format_docstring(test_key, test_args, args):

0 commit comments

Comments
 (0)