fix: io tests for corr now properly clean up

This commit is contained in:
Fabian Joswig 2022-01-19 10:46:33 +00:00
parent 9b52a9a615
commit c8ec5909f1

View file

@ -105,6 +105,7 @@ def test_json_corr_io():
my_corr.tag = corr_tag
pe.input.json.dump_to_json(my_corr, 'corr')
recover = pe.input.json.load_json('corr')
os.remove('corr.json.gz')
assert np.all([o.is_zero() for o in [x for x in (my_corr - recover) if x is not None]])
assert my_corr.tag == recover.tag
assert my_corr.reweighted == recover.reweighted
@ -120,5 +121,6 @@ def test_json_corr_2d_io():
my_corr.tag = tag
pe.input.json.dump_to_json(my_corr, 'corr')
recover = pe.input.json.load_json('corr')
os.remove('corr.json.gz')
assert np.all([np.all([o.is_zero() for o in q]) for q in [x.ravel() for x in (my_corr - recover) if x is not None]])
assert my_corr.tag == recover.tag