diff --git a/tests/test_printer/test_schema_directives.py b/tests/test_printer/test_schema_directives.py index 1a87577367..f25f9a6260 100644 --- a/tests/test_printer/test_schema_directives.py +++ b/tests/test_printer/test_schema_directives.py @@ -533,6 +533,7 @@ class Query: assert print_schema(schema) == textwrap.dedent(expected_output).strip() + def test_dedupe_multiple_equal_directives(): class MemberRoleRequired(BasePermission): message = "Keine Rechte" @@ -544,9 +545,11 @@ def has_permission(self, source, info: Info, **kwargs) -> bool: class MyInterface: id: strawberry.ID - @strawberry.field(extensions=[PermissionExtension(permissions=[MemberRoleRequired()])]) + @strawberry.field( + extensions=[PermissionExtension(permissions=[MemberRoleRequired()])] + ) def hello(info: Info) -> str: - return 'world' + return "world" @strawberry.type class MyType1(MyInterface): @@ -558,10 +561,9 @@ class MyType2(MyInterface): @strawberry.type class Query: - @strawberry.field def my_type(info: Info) -> MyInterface: - return MyType1(id='1', name='Hello') + return MyType1(id="1", name="Hello") expected_output = """ directive @memberRoleRequired on FIELD_DEFINITION