MCPcopy Create free account
hub / github.com/pytest-dev/pytest / mkpydir

Method mkpydir

src/_pytest/pytester.py:911–920  ·  view source on GitHub ↗

Create a new python package. This creates a (sub)directory with an empty ``__init__.py`` file so it gets recognised as a Python package.

(self, name: str)

Source from the content-addressed store, hash-verified

909 return p
910
911 def mkpydir(self, name: str) -> Path:
912 """Create a new python package.
913
914 This creates a (sub)directory with an empty ``__init__.py`` file so it
915 gets recognised as a Python package.
916 """
917 p = self.path / name
918 p.mkdir()
919 p.joinpath("__init__.py").touch()
920 return p
921
922 def copy_example(self, name: Optional[str] = None) -> Path:
923 """Copy file from project's directory into the testdir.

Calls 1

mkdirMethod · 0.45

Tested by

no test coverage detected