Skip to content

Commit

Permalink
Fix broken unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
mhostetter committed Jun 14, 2024
1 parent 7809a7d commit bfbc148
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tests/sequences/test_preferred_pairs.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,23 @@


def test_exceptions():
# NOTE: Need to use next() to get the exception
with pytest.raises(TypeError):
# Degree must be an integer
sdr.preferred_pairs(6.0)
next(sdr.preferred_pairs(6.0))
with pytest.raises(ValueError):
# Degree must be positive
sdr.preferred_pairs(-1)
next(sdr.preferred_pairs(-1))

with pytest.raises(TypeError):
# Polynomial must be polynomial like
sdr.preferred_pairs(6, poly1=1.0)
next(sdr.preferred_pairs(6, poly1=1.0))
with pytest.raises(ValueError):
# Polynomial must be a primitive polynomial
sdr.preferred_pairs(6, poly1=galois.Poly([1, 0, 0, 0, 0, 0, 1]))
next(sdr.preferred_pairs(6, poly1=galois.Poly([1, 0, 0, 0, 0, 0, 1])))
with pytest.raises(ValueError):
# Polynomial must have correct degree
sdr.preferred_pairs(6, poly1=galois.Poly.Degrees([4, 1, 0]))
next(sdr.preferred_pairs(6, poly1=galois.Poly.Degrees([4, 1, 0])))


def test_degree_divides_4():
Expand Down

0 comments on commit bfbc148

Please sign in to comment.