Skip to content

Commit

Permalink
improve unit test assertion error messaging
Browse files Browse the repository at this point in the history
  • Loading branch information
ndharasz committed Sep 10, 2024
1 parent 17a8ab4 commit 1abdfbe
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions tests/test_signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,13 @@ def test_churn(self):
)

def test_churn_tb(self):
assert np.isclose(churn(self.up, self.up, top_bottom=2), 0)
assert np.isclose(churn(self.up, self.up_down, top_bottom=2), 0.5)
assert np.isclose(churn(self.up, self.oscillate, top_bottom=2), 0.5)
assert np.isclose(churn(self.up, self.down, top_bottom=2), 1)
assert np.isclose(churn(self.up, self.constant, top_bottom=2), 0)
tmp = churn(self.up, self.up, top_bottom=2)
assert np.isclose(tmp, 0), tmp
tmp = churn(self.up, self.up_down, top_bottom=2)
assert np.isclose(tmp, 0.5), tmp
tmp = churn(self.up, self.oscillate, top_bottom=2)
assert np.isclose(tmp, 0.5), tmp
tmp = churn(self.up, self.down, top_bottom=2)
assert np.isclose(tmp, 1), tmp
tmp = churn(self.up, self.constant, top_bottom=2)
assert np.isclose(tmp, 0), tmp

0 comments on commit 1abdfbe

Please sign in to comment.