Open lucasmbrown-usds opened 2 years ago
Description If we added a simple global constant like UPDATE_PICKLES = False to the data/data-pipeline/data_pipeline/etl/score/tests/test_score_post.py file, then when you need to update the pickles, you just set that parameter to True.
UPDATE_PICKLES = False
data/data-pipeline/data_pipeline/etl/score/tests/test_score_post.py
And within each test, it would be something like:
if UPDATE_PICKLES: data_path = Path.cwd() score_transformed_actual.to_pickle(data_path / "data_pipeline" / "etl" / "score" / "tests" / "snapshots" / "score_transformed_expected.pkl", protocol=4) pytest.fail("Test fails because `UPDATE_PICKLES` is True.") else: pdt.assert_frame_equal( score_transformed_actual, score_transformed_expected, check_dtype=False )
We would never set UPDATE_PICKLES = True in the actual code in the app, it would just be used to temporarily update these things.
UPDATE_PICKLES = True
Instead, copy or expand upon framework developed by https://github.com/usds/justice40-tool/pull/1249.
Potentially copy or expand upon framework developed by https://github.com/usds/justice40-tool/pull/1249
Description
If we added a simple global constant likeUPDATE_PICKLES = False
to thedata/data-pipeline/data_pipeline/etl/score/tests/test_score_post.py
file, then when you need to update the pickles, you just set that parameter to True.And within each test, it would be something like:We would never setUPDATE_PICKLES = True
in the actual code in the app, it would just be used to temporarily update these things.Instead, copy or expand upon framework developed by https://github.com/usds/justice40-tool/pull/1249.