Skip to content

Commit 0729451

Browse files
committed
Fix testing
1 parent 00340d9 commit 0729451

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

.continuous-integration/travis/setup_dependencies_common.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ $CONDA_INSTALL pytest Cython jinja2 psutil
3030
# OPTIONAL DEPENDENCIES
3131
if $OPTIONAL_DEPS
3232
then
33-
$CONDA_INSTALL scipy h5py matplotlib pyyaml scikit-image
33+
$CONDA_INSTALL scipy h5py matplotlib pyyaml scikit-image pandas
3434
pip install beautifulsoup4
3535
fi
3636

astropy/table/tests/test_table.py

+10
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@
1515
from ... import units as u
1616
from .conftest import MaskedTable
1717

18+
try:
19+
import pandas
20+
except ImportError:
21+
HAS_PANDAS = False
22+
else:
23+
HAS_PANDAS = True
24+
1825

1926
class SetupData(object):
2027
def _setup(self, table_types):
@@ -1402,6 +1409,7 @@ def test_table_init_from_degenerate_arrays(table_types):
14021409

14031410
class TestPandas(object):
14041411

1412+
@pytest.mark.skipif('not HAS_PANDAS')
14051413
def test_simple(self):
14061414

14071415
from pandas import DataFrame
@@ -1436,6 +1444,7 @@ def test_simple(self):
14361444
else:
14371445
assert_allclose(t[column], t2[column])
14381446

1447+
@pytest.mark.skipif('not HAS_PANDAS')
14391448
def test_2d(self):
14401449

14411450
from pandas import DataFrame
@@ -1448,6 +1457,7 @@ def test_2d(self):
14481457
d = t.to_pandas()
14491458
assert exc.value.args[0] == "Cannot convert a table with multi-dimensional columns to a pandas DataFrame"
14501459

1460+
@pytest.mark.skipif('not HAS_PANDAS')
14511461
def test_mixin(self):
14521462

14531463
from pandas import DataFrame

0 commit comments

Comments
 (0)