def test_no_duplicate_extensions_with_directives():
    """Test to verify that extensions are not duplicated when directives are present.

    This test initially fails with the current implementation but passes
    after fixing the get_extensions method.
    """

    schema = strawberry.Schema(
        query=Query, extensions=[MyExtension], directives=[uppercase]
    )

    extensions = schema.get_extensions()

    # Count how many times our extension appears
    ext_count = sum(1 for e in extensions if isinstance(e, MyExtension))

    # With current implementation this fails as ext_count is 2
    assert ext_count == 1, f"Extension appears {ext_count} times instead of once"
Test to verify that extensions are not duplicated when directives are present.

    This test initially fails with the current implementation but passes
    after fixing the get_extensions method.
    
tests/schema/test_get_extensions.py