We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8aa5b58 commit feb1ef3Copy full SHA for feb1ef3
1 file changed
tests/conftest.py
@@ -69,6 +69,8 @@ def _create_files(files: Set[Tuple[FileTypes, str]]):
69
if not isinstance(file_type, FileTypes):
70
raise ValueError(f"Invalid file type: {file_type}")
71
write_file_name = tmp_path / Path(file_name)
72
+ # create the subfolder (if file name is a path with folders)
73
+ write_file_name.parent.mkdir(parents=True, exist_ok=True)
74
75
read_file_path = Path("tests/data")
76
read_file_name: Path = None
@@ -96,8 +98,8 @@ def _create_files(files: Set[Tuple[FileTypes, str]]):
96
98
97
99
with open(read_file_name, "r") as f:
100
content = f.read()
- with open(write_file_name, "w+") as f2:
- f2.write(content)
101
+ with open(write_file_name, "w+") as f:
102
+ f.write(content)
103
104
return tmp_path
105
0 commit comments