Skip to content

Commit 77f337b

Browse files
aysim319minhkhul
andauthored
Apply suggestions from code review
Co-authored-by: minhkhul <118945681+minhkhul@users.noreply.github.com>
1 parent c853c99 commit 77f337b

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

nssp/tests/conftest.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@ def params_w_patch(params):
6262

6363
@pytest.fixture(scope="function")
6464
def run_as_module(params):
65+
"""
66+
Fixture to use TEST_DATA when testing run_module.
67+
68+
This fixture patches Socrara to return the predefined test data
69+
"""
70+
6571
with patch('sodapy.Socrata.get') as mock_get:
6672
def side_effect(*args, **kwargs):
6773
if kwargs['offset'] == 0:
@@ -76,6 +82,12 @@ def side_effect(*args, **kwargs):
7682

7783
@pytest.fixture(scope="function")
7884
def run_as_module_hrr(params):
85+
"""
86+
Fixture to use HRR_TEST_DATA when testing run_module.
87+
88+
This fixture patches socrara to return the predefined test data for HRR region.
89+
"""
90+
7991
with patch('sodapy.Socrata.get') as mock_get, \
8092
patch('delphi_nssp.run.GEOS', ["hrr"]):
8193
def side_effect(*args, **kwargs):

nssp/tests/test_run.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ def test_output_files_exist(self, params, run_as_module):
5858

5959
assert set(csv_files) == set(expected_files)
6060

61+
# Verify that all generated file have correct columns.
6162
for geo in GEOS:
6263
df = pd.read_csv(
6364
f"{export_dir}/weekly_{date_prefix[2]}_{geo}_{metrics[0]}.csv")

0 commit comments

Comments
 (0)