diff --git a/filecheck/filecheck.py b/filecheck/filecheck.py index be90b82..65fd65f 100644 --- a/filecheck/filecheck.py +++ b/filecheck/filecheck.py @@ -326,7 +326,7 @@ class File(FileBase): def make_tempdir(self) -> Path: """Make a temporary directory at self.tempdir_path.""" if not self.tempdir_path.exists(): - self.tempdir_path.mkdir() + self.tempdir_path.mkdir(parents=True) return self.tempdir_path ####################### diff --git a/kittengroomer/helpers.py b/kittengroomer/helpers.py index 9d2ef4e..4d4eae9 100644 --- a/kittengroomer/helpers.py +++ b/kittengroomer/helpers.py @@ -316,7 +316,7 @@ class KittenGroomerBase(object): def safe_mkdir(self, directory_path: Path): """Make a directory if it does not exist.""" if not directory_path.exists(): - os.makedirs(directory_path) + directory_path.mkdir(parents=True) def list_all_files(self, directory_path: Path) -> Iterator[Path]: """Generator yielding path to all of the files in a directory tree.""" diff --git a/tests/test_kittengroomer.py b/tests/test_kittengroomer.py index 6ab4ee6..11d677c 100644 --- a/tests/test_kittengroomer.py +++ b/tests/test_kittengroomer.py @@ -254,7 +254,7 @@ class TestFileBase: file = FileBase(file_path, dst_path) with mock.patch('kittengroomer.helpers.shutil.copy') as mock_copy: file.safe_copy() - mock_copy.assert_called_once_with(str(file_path), str(dst_path)) + mock_copy.assert_called_once_with(file_path, dst_path) def test_safe_copy_removes_exec_perms(self): """`safe_copy` should create a file that doesn't have any of the