Skip to content

Commit 717e0cf

Browse files
Debian Science Teamrebecca-palmer
Debian Science Team
authored andcommitted
Skip tests when dependencies are missing
Author: Rebecca N. Palmer <[email protected]> Forwarded: no Gbp-Pq: Name add_missing_importorskip.patch
1 parent 2e6ab60 commit 717e0cf

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

pandas/tests/io/formats/style/test_bar.py

+1
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,7 @@ def test_styler_bar_with_NA_values():
347347
assert expected_substring in html_output2
348348

349349

350+
@td.skip_if_no("pyarrow")
350351
def test_style_bar_with_pyarrow_NA_values():
351352
data = """name,age,test1,test2,teacher
352353
Adam,15,95.0,80,Ashby

pandas/tests/io/parser/conftest.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
read_table,
1313
)
1414
import pandas._testing as tm
15+
import pandas.util._test_decorators as td
1516

1617

1718
class BaseParser:
@@ -118,7 +119,7 @@ def csv1(datapath):
118119

119120
_py_parsers_only = [_pythonParser]
120121
_c_parsers_only = [_cParserHighMemory, _cParserLowMemory]
121-
_pyarrow_parsers_only = [pytest.param(_pyarrowParser, marks=pytest.mark.single_cpu)]
122+
_pyarrow_parsers_only = [pytest.param(_pyarrowParser, marks=[pytest.mark.single_cpu, td.skip_if_no("pyarrow")])]
122123

123124
_all_parsers = [*_c_parsers_only, *_py_parsers_only, *_pyarrow_parsers_only]
124125

@@ -182,8 +183,8 @@ def _get_all_parser_float_precision_combinations():
182183
parser = parser.values[0]
183184
for precision in parser.float_precision_choices:
184185
# Re-wrap in pytest.param for pyarrow
185-
mark = pytest.mark.single_cpu if parser.engine == "pyarrow" else ()
186-
param = pytest.param((parser(), precision), marks=mark)
186+
marks = [pytest.mark.single_cpu, td.skip_if_no("pyarrow")] if parser.engine == "pyarrow" else ()
187+
param = pytest.param((parser(), precision), marks=marks)
187188
params.append(param)
188189
ids.append(f"{parser_id}-{precision}")
189190

pandas/tests/series/test_api.py

+1
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ def test_attrs(self):
171171
def test_inspect_getmembers(self):
172172
# GH38782
173173
td.versioned_importorskip("jinja2")
174+
td.versioned_importorskip("pyarrow")
174175
ser = Series(dtype=object)
175176
msg = "Series._data is deprecated"
176177
with tm.assert_produces_warning(

0 commit comments

Comments
 (0)