Skip to content

Commit 783ab24

Browse files
committed
fixed test
1 parent 77662dc commit 783ab24

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

nhsn/tests/test_patch.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,14 +114,15 @@ def test_patch(self, params_w_patch):
114114
file_list, prelim_file_list = self.generate_test_source_files()
115115
patch(params_w_patch)
116116

117-
for issue_path in Path(f"{TEST_DIR}/patch_dir").glob("*"):
117+
for issue_path in Path(f"{TEST_DIR}/patch_dir").glob("issue*"):
118118
issue_dt_str = issue_path.name.replace("issue_", "")
119119
for file in Path(issue_path / "nhsn").iterdir():
120120
df = pd.read_csv(file)
121121
assert issue_dt_str == str(int(df["val"][0]))
122122

123123
# clean up
124-
shutil.rmtree(f"{TEST_DIR}/patch_dir")
124+
for file in Path(f"{TEST_DIR}/patch_dir").glob("issue*"):
125+
shutil.rmtree(file)
125126

126127
for file in file_list:
127128
os.remove(file)
@@ -143,7 +144,8 @@ def test_patch_incomplete_file(self, params_w_patch):
143144
dates = set([re.search(r"\d{6}", file.name).group() for file in files])
144145
assert len(files) == len(GEOS) * len(existing_signals) * len(dates)
145146
# clean up
146-
shutil.rmtree(f"{TEST_DIR}/patch_dir")
147+
for file in Path(f"{TEST_DIR}/patch_dir").glob("issue*"):
148+
shutil.rmtree(file)
147149

148150

149151

0 commit comments

Comments
 (0)