Skip to content

Commit

Permalink
TST:MNT: Ignore expected division by zero
Browse files Browse the repository at this point in the history
  • Loading branch information
scottclowe committed Jul 13, 2021
1 parent 27be3b1 commit c52e55e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions fissa/tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1040,7 +1040,11 @@ def test_calcdeltaf_cache(self):
def test_calcdeltaf_notrawf0(self):
exp = core.Experiment(self.images_dir, self.roi_zip_path, verbosity=4)
exp.separate()
exp.calc_deltaf(self.fs, use_raw_f0=False)
# Ignore division by zero, which is likely to occur now and something
# we want to alert the user to.
with warnings.catch_warnings():
warnings.filterwarnings("ignore", message="divide by zero")
exp.calc_deltaf(self.fs, use_raw_f0=False)
# We did not use this setting to generate the expected values, so can't
# compare the output against the target.
self.compare_output(exp, compare_deltaf=False)
Expand All @@ -1062,7 +1066,11 @@ def test_calcdeltaf_notacrosstrials(self):
def test_calcdeltaf_notrawf0_notacrosstrials(self):
exp = core.Experiment(self.images_dir, self.roi_zip_path, verbosity=4)
exp.separate()
exp.calc_deltaf(self.fs, use_raw_f0=False, across_trials=False)
# Ignore division by zero, which is likely to occur now and something
# we want to alert the user to.
with warnings.catch_warnings():
warnings.filterwarnings("ignore", message="divide by zero")
exp.calc_deltaf(self.fs, use_raw_f0=False, across_trials=False)
# We did not use this setting to generate the expected values, so can't
# compare the output against the target.
self.compare_output(exp, compare_deltaf=False)
Expand Down

0 comments on commit c52e55e

Please sign in to comment.