Skip to content

Commit b2f90ae

Browse files
committed
Skip tests using APPVEYOR env variable.
1 parent c918710 commit b2f90ae

7 files changed

Lines changed: 19 additions & 18 deletions

File tree

‎astropy/analytic_functions/tests/test_blackbody.py‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"""Tests for blackbody functions."""
33
from __future__ import (absolute_import, division, print_function,
44
unicode_literals)
5-
import platform
5+
6+
import os
67
# THIRD-PARTY
78
import numpy as np
89

@@ -23,7 +24,7 @@
2324
__doctest_skip__ = ['*']
2425

2526

26-
@pytest.mark.skipif(platform.system() == 'Windows', reason="fails on AppVeyor")
27+
@pytest.mark.skipif(os.environ.get('APPVEYOR'), reason="fails on AppVeyor")
2728
@pytest.mark.skipif('not HAS_SCIPY')
2829
def test_blackbody_scipy():
2930
"""Test Planck function.
@@ -44,7 +45,7 @@ def test_blackbody_scipy():
4445
np.testing.assert_allclose(intflux, ans.value, rtol=0.01) # 1% accuracy
4546

4647

47-
@pytest.mark.skipif(platform.system() == 'Windows', reason="fails on AppVeyor")
48+
@pytest.mark.skipif(os.environ.get('APPVEYOR'), reason="fails on AppVeyor")
4849
def test_blackbody_overflow():
4950
"""Test Planck function with overflow."""
5051
photlam = u.photon / (u.cm**2 * u.s * u.AA)
@@ -66,7 +67,7 @@ def test_blackbody_overflow():
6667
assert flux.value == 0
6768

6869

69-
@pytest.mark.skipif(platform.system() == 'Windows', reason="fails on AppVeyor")
70+
@pytest.mark.skipif(os.environ.get('APPVEYOR'), reason="fails on AppVeyor")
7071
def test_blackbody_synphot():
7172
"""Test that it is consistent with IRAF SYNPHOT BBFUNC."""
7273
# Solid angle of solar radius at 1 kpc

‎astropy/io/ascii/tests/test_c_reader.py‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
StringIO = lambda x: BytesIO(x.encode('ascii'))
88
from tempfile import NamedTemporaryFile
99
import os
10-
import platform
1110

1211
import numpy as np
1312
from numpy import ma
@@ -24,7 +23,7 @@
2423

2524
TRAVIS = os.environ.get('TRAVIS', False)
2625

27-
pytestmark = pytest.mark.skipif(platform.system() == 'Windows', reason="fails on AppVeyor")
26+
pytestmark = pytest.mark.skipif(os.environ.get('APPVEYOR'), reason="fails on AppVeyor")
2827

2928

3029
def assert_table_equal(t1, t2):

‎astropy/io/ascii/tests/test_read.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
# TEST_UNICODE_LITERALS
44

5+
import os
56
import re
6-
import platform
77

88
import numpy as np
99

@@ -96,7 +96,7 @@ def test_read_with_names_arg(fast_reader):
9696
dat = ascii.read(['c d', 'e f'], names=('a', ), guess=False, fast_reader=fast_reader)
9797

9898

99-
@pytest.mark.skipif(platform.system() == 'Windows', reason="fails on AppVeyor")
99+
@pytest.mark.skipif(os.environ.get('APPVEYOR'), reason="fails on AppVeyor")
100100
@pytest.mark.parametrize('fast_reader', [True, False, 'force'])
101101
def test_read_all_files(fast_reader):
102102
for testfile in get_testfiles():
@@ -118,7 +118,7 @@ def test_read_all_files(fast_reader):
118118
assert_equal(len(table[colname]), testfile['nrows'])
119119

120120

121-
@pytest.mark.skipif(platform.system() == 'Windows', reason="fails on AppVeyor")
121+
@pytest.mark.skipif(os.environ.get('APPVEYOR'), reason="fails on AppVeyor")
122122
@pytest.mark.parametrize('fast_reader', [True, False, 'force'])
123123
def test_read_all_files_via_table(fast_reader):
124124
for testfile in get_testfiles():
@@ -205,7 +205,7 @@ def test_daophot_multiple_aperture():
205205
assert np.all(table['RAPERT5'] == 23.3) # assert all the 5th apertures are same 23.3
206206

207207

208-
@pytest.mark.skipif(platform.system() == 'Windows', reason="fails on AppVeyor")
208+
@pytest.mark.skipif(os.environ.get('APPVEYOR'), reason="fails on AppVeyor")
209209
@pytest.mark.parametrize('fast_reader', [True, False, 'force'])
210210
def test_empty_table_no_header(fast_reader):
211211
with pytest.raises(ascii.InconsistentTableError):

‎astropy/io/ascii/tests/test_write.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
# TEST_UNICODE_LITERALS
44

5+
import os
56
import copy
6-
import platform
77

88
try:
99
from cStringIO import StringIO
@@ -460,7 +460,7 @@ def test_strip_names(fast_writer):
460460
assert out.getvalue().splitlines()[0] == 'A,B,C'
461461

462462

463-
@pytest.mark.skipif(platform.system() == 'Windows', reason="fails on AppVeyor")
463+
@pytest.mark.skipif(os.environ.get('APPVEYOR'), reason="fails on AppVeyor")
464464
def test_latex_units():
465465
"""
466466
Check to make sure that Latex and AASTex writers attempt to fall

‎astropy/io/fits/tests/test_uint.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Licensed under a 3-clause BSD style license - see PYFITS.rst
22

3+
import os
34
import platform
45

56
import numpy as np
@@ -23,7 +24,7 @@ def setup_class(cls):
2324
@pytest.mark.parametrize(('utype','compressed'),
2425
[('u2', False), ('u4', False), ('u8', False), ('u2', True),
2526
('u4',True)]) #,('u8',True)])
26-
@pytest.mark.skipif(platform.system() == 'Windows', reason="fails on AppVeyor")
27+
@pytest.mark.skipif(os.environ.get('APPVEYOR'), reason="fails on AppVeyor")
2728
def test_uint(self, utype, compressed):
2829
bits = 8*int(utype[1])
2930
if platform.architecture()[0] == '64bit' or bits != 64:

‎astropy/io/misc/tests/test_hdf5.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import print_function
44

5-
import platform
5+
import os
66

77
import numpy as np
88

@@ -120,7 +120,7 @@ def test_read_write_simple(tmpdir):
120120

121121

122122
@pytest.mark.skipif('not HAS_H5PY')
123-
@pytest.mark.skipif(platform.system() == 'Windows', reason="fails on AppVeyor")
123+
@pytest.mark.skipif(os.environ.get('APPVEYOR'), reason="fails on AppVeyor")
124124
def test_read_write_existing_table(tmpdir):
125125
test_file = str(tmpdir.join('test.hdf5'))
126126
t1 = Table()
@@ -193,7 +193,7 @@ def test_read_write_existing_append_groups(tmpdir):
193193

194194

195195
@pytest.mark.skipif('not HAS_H5PY')
196-
@pytest.mark.skipif(platform.system() == 'Windows', reason="fails on AppVeyor")
196+
@pytest.mark.skipif(os.environ.get('APPVEYOR'), reason="fails on AppVeyor")
197197
def test_read_write_existing_append_overwrite(tmpdir):
198198
test_file = str(tmpdir.join('test.hdf5'))
199199
t1 = Table()

‎astropy/nddata/tests/test_flag_collection.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# TEST_UNICODE_LITERALS
44

55
from __future__ import absolute_import, division, print_function, unicode_literals
6-
import platform
6+
import os
77

88
import numpy as np
99

@@ -43,7 +43,7 @@ def test_setitem_invalid_type(value):
4343
assert exc.value.args[0] == 'flags should be given as a Numpy array'
4444

4545

46-
@pytest.mark.skipif(platform.system() == 'Windows', reason="fails on AppVeyor")
46+
@pytest.mark.skipif(os.environ.get('APPVEYOR'), reason="fails on AppVeyor")
4747
def test_setitem_invalid_shape():
4848
f = FlagCollection(shape=(1, 2, 3))
4949
with pytest.raises(Exception) as exc:

0 commit comments

Comments
 (0)