def test_parent_frame_namespace(create_module) -> None:
    """Parent frame namespace should be `None` because we skip fetching data from the top module level."""

    @create_module
    def mod1() -> None:
        from pydantic._internal._typing_extra import parent_frame_namespace

        module_foo = 'global_foo'  # noqa: F841
        module_ns = parent_frame_namespace(parent_depth=1)  # noqa: F841
        module_ns_force = parent_frame_namespace(parent_depth=1, force=True)  # noqa: F841

    assert mod1.module_ns is None
    assert mod1.module_ns_force is not None
Parent frame namespace should be `None` because we skip fetching data from the top module level.
tests/test_typing.py