Skip to content

Commit

Permalink
try to improve coverage of tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vmarandon committed Sep 8, 2023
1 parent 959d4e9 commit 41d6081
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/nectarchain/tests/test_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,3 +153,16 @@ def test_stats_print():
assert s.__str__() == 'mean: [2.]\nstd: [1.]\nmin: [1.]\nmax: [3.]\ncount: [3]\nshape: (1,)'
assert s.__repr__() == s.__str__()

def test_stats_badmerge():
import numpy as np
from nectarchain.utils.stats import Stats

s = Stats()
s.add(1)

s2 = Stats(5)
s2.add([1,2,3,4,5])


with pytest.raises(ValueError, match="Trying to merge from a different shape this:.*"):
s.merge(s2)

0 comments on commit 41d6081

Please sign in to comment.