Skip to content

Commit

Permalink
tests: only write synth dataset to disk if requested
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinBernstorff committed Mar 9, 2023
1 parent 4f14df7 commit 1fce022
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/test_synth_data_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

def test_synth_data_generator():
"""Test synth data generator."""
WRITE_NEW_TO_DISK = False

column_specifications = [
{"citizen_ids": {"column_type": "uniform_int", "min": 0, "max": 1_200_001}},
{"timestamp": {"column_type": "datetime_uniform", "min": 0, "max": 5 * 365}},
Expand Down Expand Up @@ -59,5 +61,6 @@ def test_synth_data_generator():

assert na_prop > 0.02 and na_prop < 0.2

save_path = PROJECT_ROOT
synth_df.to_csv(save_path / "tests" / "test_data" / "synth_prediction_data.csv")
if WRITE_NEW_TO_DISK:
save_path = PROJECT_ROOT
synth_df.to_csv(save_path / "tests" / "test_data" / "synth_prediction_data.csv")

0 comments on commit 1fce022

Please sign in to comment.