def test_ensure_dir_raise(self, tmpdir): with pytest.raises(InvalidOption): ensure_dir(tmpdir, path_type='cwd')
def test_ensure_dir(self, tmpdir, subpath, path_type, expected_path): dir_path = Path(tmpdir) / Path(subpath) ensure_dir(dir_path, path_type=path_type) assert (Path(tmpdir) / Path(expected_path)).exists()