Skip to content

Commit

Permalink
Change to 'assert' message to hunt memory leaks
Browse files Browse the repository at this point in the history
Change to 'assert' for GSAOI test
  • Loading branch information
DBerke committed Feb 2, 2024
1 parent 2526134 commit 06014e1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion geminidr/gmos/recipes/ql/tests/test_ls_spect.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ def reduce(file_list, label, calib_files, recipe_name=None, save_to=None,
[os.remove(f) for f in r.output_filenames]

# check that we are not leaking objects
assert len(objgraph.by_type('NDAstroData')) == 0
assert len(objgraph.by_type('NDAstroData')) == 0, ("Leaking objects",
[x.shape for x in objgraph.by_type('NDAstroData')])

return calib_files

Expand Down
3 changes: 2 additions & 1 deletion geminidr/gmos/recipes/sq/tests/test_ls_spect.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ def reduce(file_list, label, calib_files, recipe_name=None, save_to=None,
[os.remove(f) for f in r.output_filenames]

# check that we are not leaking objects
assert len(objgraph.by_type('NDAstroData')) == 0
assert len(objgraph.by_type('NDAstroData')) == 0, ("Leaking objects",
[x.shape for x in objgraph.by_type('NDAstroData')])

return calib_files

Expand Down
5 changes: 4 additions & 1 deletion geminidr/gsaoi/recipes/tests/test_reduce_gsaoi.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,10 @@ def reduce(file_list, label, calib_files, recipe_name=None, save_to=None,
[os.remove(f) for f in r.output_filenames]

# check that we are not leaking objects
assert len(objgraph.by_type('NDAstroData')) == 0
assert len(objgraph.by_type('NDAstroData')) == 0, ("Leaking objects",
[x.shape for x in objgraph.by_type('NDAstroData')],
[x.filename for x in objgraph.by_type("AstroDataGsaoi")],
f'{label=}')

return output_file, calib_files

Expand Down

0 comments on commit 06014e1

Please sign in to comment.