-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove xpass cases and turn xpass into failures #7267
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -321,7 +321,6 @@ def test_mad_std(): | |
assert_allclose(funcs.mad_std(data), 2.0, rtol=0.05) | ||
|
||
|
||
@pytest.mark.xfail() | ||
def test_mad_std_scalar_return(): | ||
with NumpyRNGContext(12345): | ||
data = normal(5, 2, size=(10, 10)) | ||
|
@@ -337,7 +336,10 @@ def test_mad_std_scalar_return(): | |
with catch_warnings(): | ||
rslt = funcs.mad_std(data) | ||
assert np.isscalar(rslt) | ||
assert not np.isnan(rslt) | ||
try: | ||
assert not np.isnan(rslt) | ||
except AssertionError: | ||
pytest.xfail('See #5232') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That PR discussion is really long; maybe add a link to a specific comment that summarizes the expected fail? I don't remember if this particular test is expected to fail only on certain numpy versions or what... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wasn't involved in that discussion and can't follow it completely (it is very long). Is #5232 (comment) close enough? It does seem weird that this test would only There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ...it would probably take me half an hour to figure it out reading back through that. Oh well, let's just leave the comment here - at least it is theoretically possible to reconstruct my mental state at the time... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay then. 😉 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If that comment is right, this problem will auto-disappear in 3.1, since we'll only support numpy >=1.13 That also suggests, though, this should really be a test on numpy version. I don't really want to hold up this supposedly simple PR, but could you add a comment that might well be resolved in later numpy? Please include something like |
||
|
||
|
||
def test_mad_std_warns(): | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -937,7 +937,6 @@ def test_two_argument_ufunc_at(self): | |
np.greater.at(s, i, 1.*u.km) | ||
|
||
|
||
@pytest.mark.xfail("NUMPY_LT_1_13") | ||
class TestUfuncReduceReduceatAccumulate: | ||
"""Test 'reduce', 'reduceat' and 'accumulate' methods for ufuncs | ||
|
||
|
@@ -955,6 +954,7 @@ def test_one_argument_ufunc_reduce_accumulate(self): | |
with pytest.raises(ValueError): | ||
np.sin.reduceat(s, i) | ||
|
||
@pytest.mark.xfail("NUMPY_LT_1_13") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, that's a nice one - the other test method already gives the right failures! |
||
def test_two_argument_ufunc_reduce_accumulate(self): | ||
s = np.arange(10.) * u.m | ||
i = np.array([0, 5, 1, 6]) | ||
|
@@ -1012,7 +1012,6 @@ def test_two_argument_ufunc_reduce_accumulate(self): | |
assert s_multiply_reduceat.unit is u.dimensionless_unscaled | ||
|
||
|
||
@pytest.mark.xfail("NUMPY_LT_1_13") | ||
class TestUfuncOuter: | ||
"""Test 'outer' methods for ufuncs | ||
|
||
|
@@ -1026,6 +1025,7 @@ def test_one_argument_ufunc_outer(self): | |
with pytest.raises(ValueError): | ||
np.sin.outer(s) | ||
|
||
@pytest.mark.xfail("NUMPY_LT_1_13") | ||
def test_two_argument_ufunc_outer(self): | ||
s1 = np.arange(10.) * u.m | ||
s2 = np.arange(2.) * u.s | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we ever want to test multi-D arrays, this would fail. How about