Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/8185-tests-refactor' into 8185-t…
Browse files Browse the repository at this point in the history
…ests-refactor
  • Loading branch information
garciadias committed Dec 11, 2024
2 parents 98d3ab2 + 56c2a48 commit 6d1af88
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions tests/visualize/utils/test_matshow3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ def test_3d(self):
tempimg = f"{tempdir}/matshow3d_test.png"
fig.savefig(tempimg)
comp = compare_images(f"{testing_dir}/matshow3d_test.png", tempimg, 5e-2)
self.assertIsNone(comp, f"value of comp={comp}") # None indicates test passed
self.assertIsNone(
comp, f"value of comp={comp}"
) # None indicates test passed

_, axes = pyplot.subplots()
matshow3d(
Expand Down Expand Up @@ -113,7 +115,9 @@ def test_samples(self):
print("not none comp: ", comp) # matplotlib 3.2.2
np.testing.assert_allclose(comp["rms"], 30.786983, atol=1e-3, rtol=1e-3)
else:
self.assertIsNone(comp, f"value of comp={comp}") # None indicates test passed
self.assertIsNone(
comp, f"value of comp={comp}"
) # None indicates test passed

def test_3d_rgb(self):
test_dir = Path(__file__).parents[2].as_posix()
Expand Down Expand Up @@ -145,8 +149,12 @@ def test_3d_rgb(self):
with tempfile.TemporaryDirectory() as tempdir:
tempimg = f"{tempdir}/matshow3d_rgb_test.png"
fig.savefig(tempimg)
comp = compare_images(f"{testing_dir}/matshow3d_rgb_test.png", tempimg, 5e-2)
self.assertIsNone(comp, f"value of comp={comp}") # None indicates test passed
comp = compare_images(
f"{testing_dir}/matshow3d_rgb_test.png", tempimg, 5e-2
)
self.assertIsNone(
comp, f"value of comp={comp}"
) # None indicates test passed


if __name__ == "__main__":
Expand Down

0 comments on commit 6d1af88

Please sign in to comment.