Skip to content

Commit f602d6b

Browse files
committed
Fix linting
1 parent 881d966 commit f602d6b

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ required-version = ">=0.9.0"
4040

4141
[tool.ruff.format]
4242
docstring-code-format = true
43+
exclude = ["tests/data/*.pyi"]
4344

4445
[tool.ruff.lint]
4546
select = [

tests/test_stubify_functions.py

+4-7
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010

1111
@pytest.mark.parametrize(
12-
"definition, name, expected_stub",
12+
("definition", "name", "expected_stub"),
1313
[
1414
pytest.param(
1515
"""
@@ -141,21 +141,18 @@ def test_to_type_stub(definition: str, name: str, expected_stub: str) -> None:
141141
ignore_list = list(structure.typedefs.keys())
142142
structure.load(definition)
143143

144-
if name:
145-
generated_stub = getattr(structure, name).cs
146-
else:
147-
generated_stub = structure
144+
generated_stub = getattr(structure, name).cs if name else structure
148145
expected_stub = textwrap.dedent(expected_stub).strip()
149146

150-
assert expected_stub == stubify_cstruct(generated_stub, ignore_type_defs=ignore_list).strip()
147+
assert stubify_cstruct(generated_stub, ignore_type_defs=ignore_list).strip() == expected_stub
151148

152149

153150
def test_to_type_stub_empty() -> None:
154151
structure = cstruct()
155152
ignore_list = list(structure.typedefs.keys())
156153
structure.load("")
157154

158-
assert "class test(cstruct):\n ..." == stubify_cstruct(structure, "test", ignore_type_defs=ignore_list)
155+
assert stubify_cstruct(structure, "test", ignore_type_defs=ignore_list) == "class test(cstruct):\n ..."
159156

160157

161158
def test_stubify_file() -> None:

0 commit comments

Comments
 (0)