Skip to content
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

Merged
merged 4 commits into from
Mar 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions astropy/coordinates/tests/test_sky_coord_velocities.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def test_useful_error_missing():

# ----------------------Operations on SkyCoords w/ velocities-------------------

# define some fixtires to get baseline coordinates to try operations with
# define some fixtures to get baseline coordinates to try operations with
@pytest.fixture(scope="module", params=[(False, False),
(True, False),
(False, True),
Expand Down Expand Up @@ -177,12 +177,14 @@ def test_transforms(sc):
assert isinstance(trans.frame, Galactic)


@pytest.mark.xfail
def test_transforms_diff(sc):
# note that arguably this *should* fail for the no-distance cases: 3D
# information is necessary to truly solve this, hence the xfail
trans = sc.transform_to(PrecessedGeocentric(equinox='B1975'))
assert isinstance(trans.frame, PrecessedGeocentric)
if not sc.distance.unit.is_equivalent(u.m):
pytest.xfail('Should fail for no-distance cases')
else:
trans = sc.transform_to(PrecessedGeocentric(equinox='B1975'))
assert isinstance(trans.frame, PrecessedGeocentric)


@pytest.mark.skipif(str('not HAS_SCIPY'))
Expand Down
8 changes: 6 additions & 2 deletions astropy/stats/tests/test_funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -337,7 +336,12 @@ 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)
# This might not be an issue anymore when only numpy>=1.13 is
# supported. NUMPY_LT_1_13 xref #7267
except AssertionError:
pytest.xfail('See #5232')


def test_mad_std_warns():
Expand Down
4 changes: 2 additions & 2 deletions astropy/units/tests/test_quantity_ufuncs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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")
Copy link
Contributor

Choose a reason for hiding this comment

The 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])
Expand Down Expand Up @@ -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

Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ open_files_ignore = "astropy.log" "/etc/hosts"
remote_data_strict = true
addopts = -p no:warnings
asdf_schema_root = astropy/io/misc/asdf/schemas
xfail_strict = true

[bdist_wininst]
bitmap = static/wininst_background.bmp
Expand Down