def test_pkgfile(self, pytester: Pytester, monkeypatch: MonkeyPatch) -> None:
        """Verify nesting when a module is within a package.
        The parent chain should match: Module<x.py> -> Package<subdir> -> Session.
            Session's parent should always be None.
        """
        tmp_path = pytester.path
        subdir = tmp_path.joinpath("subdir")
        x = ensure_file(subdir / "x.py")
        ensure_file(subdir / "__init__.py")
        with monkeypatch.context() as mp:
            mp.chdir(subdir)
            config = pytester.parseconfigure(x)
        col = pytester.getnode(config, x)
        assert col is not None
        assert col.name == "x.py"
        assert isinstance(col, pytest.Module)
        assert isinstance(col.parent, pytest.Package)
        assert isinstance(col.parent.parent, pytest.Session)
        # session is batman (has no parents)
        assert col.parent.parent.parent is None
        for parent in col.listchain():
            assert parent.config is config
Verify nesting when a module is within a package.
        The parent chain should match: Module<x.py> -> Package<subdir> -> Session.
            Session's parent should always be None.
        
testing/test_collection.py