Skip to content

Commit 8038f7e

Browse files
committed
Revert a lot of test changes
1 parent bb0fcff commit 8038f7e

File tree

2 files changed

+28
-4
lines changed

2 files changed

+28
-4
lines changed

tests/_data/string_files/format_functions.toml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,19 @@
22
# [type, string, start, end, line]
33
# for creating a TokenInfo() object.
44

5-
[module_docstring]
5+
[module_docstring_followed_by_string]
6+
expected = 1
7+
8+
[module_docstring_followed_by_code]
9+
expected = 1
10+
11+
[module_docstring_followed_by_comment_then_code]
12+
expected = 1
13+
14+
[module_docstring_followed_by_comment_then_string]
15+
expected = 1
16+
17+
[module_docstring_in_black]
618
expected = 1
719

820
[class_docstring_followed_by_statement]

tests/formatter/test_format_functions.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,23 @@ def _get_docstring_token_and_index(tokens):
6363

6464

6565
@pytest.mark.unit
66-
def test_module_docstring_newlines():
67-
expected = TEST_STRINGS["module_docstring"]["expected"]
66+
@pytest.mark.parametrize(
67+
"test_key",
68+
[
69+
"module_docstring_followed_by_string",
70+
"module_docstring_followed_by_code",
71+
"module_docstring_followed_by_comment_then_code",
72+
"module_docstring_followed_by_comment_then_string",
73+
"module_docstring_in_black",
74+
],
75+
)
76+
def test_module_docstring_newlines(test_key):
77+
expected = TEST_STRINGS[test_key]["expected"]
6878

6979
result = _format._get_module_docstring_newlines()
70-
assert result == expected, f"\nExpected {expected}\nGot {result}"
80+
assert (
81+
result == expected
82+
), f"\nFailed {test_key}:\nExpected {expected}\nGot {result}"
7183

7284

7385
@pytest.mark.unit

0 commit comments

Comments
 (0)