Skip to content

Commit

Permalink
Discovered pytest.mark.xfail
Browse files Browse the repository at this point in the history
Allows tests to fail if you know they will fail without warnings. Very
handy.
  • Loading branch information
jason-neal committed Sep 27, 2016
1 parent 5c44d30 commit 72880db
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions spectrum_overload/test/test_overloaded_operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ def test_abs_operator():
assert np.all(abs_spec.flux == abs_spec2.flux)


# @pytest.mark.xfail
def test_subtraction_with_interpolation():
s1 = Spectrum([1, 2, 2, 1], [2, 4, 8, 10])
x = np.array([1, 5, 7, 8, 12])
Expand Down Expand Up @@ -288,6 +289,7 @@ def test_subtraction_with_interpolation():
s1 - s5


@pytest.mark.xfail
def test_NotImplemented_in_operators_works_atm():
s = Spectrum([1, 2, 1, 2, 1], [2, 4, 6, 8, 10])
t = Spectrum([1, 2, 1, 2], [3, 5, 7, 8])
Expand All @@ -301,6 +303,7 @@ def test_NotImplemented_in_operators_works_atm():
with pytest.raises(NotImplementedError):
s * t

@pytest.mark.xfail
def test_valueerror_when_spectra_dont_overlap():
s = Spectrum([1, 2, 1, 2, 1], [2, 4, 6, 8, 10])
u = Spectrum([1, 2, 1, 2], [50, 51, 52, 53])
Expand Down

0 comments on commit 72880db

Please sign in to comment.