Skip to content

Commit c6c3f10

Browse files
Better test following review
1 parent 92ef78d commit c6c3f10

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

tests/test_formatter.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
import pytest
1+
from typing import Set
22

33
from pydocstringformatter.formatting import FORMATTERS
4-
from pydocstringformatter.formatting.base import Formatter
54

65

7-
@pytest.mark.parametrize(
8-
"formatter,expected", zip(FORMATTERS, ["beginning-quotes", "closing-quotes"])
9-
)
10-
def test_name(formatter: Formatter, expected: str) -> None:
11-
"""Test that the name do not change as they're used in the options."""
12-
assert formatter.name == expected
6+
def test_name() -> None:
7+
"""Test that each formatter name exists and is unique."""
8+
formatter_names: Set[str] = set()
9+
for formatter in FORMATTERS:
10+
assert formatter.name, "Each formatter should have a name set."
11+
assert (
12+
formatter.name not in formatter_names
13+
), "Each formatter should have an unique name."
14+
formatter_names.add(formatter.name)

0 commit comments

Comments
 (0)