Skip to content

Commit 4debc31

Browse files
committed
fix broken usafacts tests to read from the proper directories
1 parent cf6f4c1 commit 4debc31

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

usafacts/tests/conftest.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
@pytest.fixture(scope="session")
1212
def run_as_module():
1313
# Clean receiving directory
14-
for fname in listdir("receiving"):
15-
remove(join("receiving", fname))
14+
for fname in listdir("../receiving"):
15+
if fname[0] == ".":
16+
continue
17+
remove(join("../receiving", fname))
1618

1719
run_module()

usafacts/tests/test_run.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
class TestRun:
1111
def test_output_files_exist(self, run_as_module):
1212

13-
csv_files = listdir("receiving")
13+
csv_files = listdir("../receiving")
1414

1515
dates = [
1616
"20200229",
@@ -48,6 +48,6 @@ def test_output_files_exist(self, run_as_module):
4848
def test_output_file_format(self, run_as_module):
4949

5050
df = pd.read_csv(
51-
join("receiving", "20200310_state_confirmed_cumulative_num.csv")
51+
join("../receiving", "20200310_state_confirmed_cumulative_num.csv")
5252
)
5353
assert (df.columns.values == ["geo_id", "val", "se", "sample_size"]).all()

usafacts/tests/test_smooth.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ def test_output_files_smoothed(self, run_as_module):
1313
dates = [str(x) for x in range(20200304, 20200311)]
1414

1515
smoothed = pd.read_csv(
16-
join("receiving",
16+
join("../receiving",
1717
f"{dates[-1]}_state_confirmed_7dav_cumulative_num.csv")
1818
)
1919

2020
raw = pd.concat([
2121
pd.read_csv(
22-
join("receiving",
22+
join("../receiving",
2323
f"{date}_state_confirmed_cumulative_num.csv")
2424
) for date in dates
2525
])

0 commit comments

Comments
 (0)