def test_private_field_defined_outside_module_scope():
    """Check compatibility of strawberry.Private when defined outside module scope."""
    global LocallyScopedSensitiveData

    @strawberry.type
    class LocallyScopedQuery:
        not_seen: "strawberry.Private[LocallyScopedSensitiveData]"

        @strawberry.field
        def accessible_info(self) -> str:
            return self.not_seen.info

    @dataclass
    class LocallyScopedSensitiveData:
        value: int
        info: str

    schema = strawberry.Schema(query=LocallyScopedQuery)

    assert "notSeen" not in str(schema)

    del LocallyScopedSensitiveData
Check compatibility of strawberry.Private when defined outside module scope.
tests/schema/test_private_field.py