diff --git a/tests/sequences/test_preferred_pairs.py b/tests/sequences/test_preferred_pairs.py index 8e18bb74f..f5ef97b51 100644 --- a/tests/sequences/test_preferred_pairs.py +++ b/tests/sequences/test_preferred_pairs.py @@ -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():