Merge pull request #9893 from jparise/pytester-mkdir-path

This commit is contained in:
Zac Hatfield-Dodds 2022-05-27 20:51:50 -07:00 committed by GitHub
commit a47e91e077
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -904,13 +904,13 @@ class Pytester:
self._monkeypatch.syspath_prepend(str(path))
def mkdir(self, name: str) -> Path:
def mkdir(self, name: Union[str, "os.PathLike[str]"]) -> Path:
"""Create a new (sub)directory."""
p = self.path / name
p.mkdir()
return p
def mkpydir(self, name: str) -> Path:
def mkpydir(self, name: Union[str, "os.PathLike[str]"]) -> Path:
"""Create a new python package.
This creates a (sub)directory with an empty ``__init__.py`` file so it