Skip to content

Commit b3d0252

Browse files
using pytest.skip instead of early return
1 parent 2bbc3fd commit b3d0252

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

pandas/tests/indexes/datetimes/test_ops.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def test_invalid_ops_properties(self, op, index_or_series_obj):
3838
if isinstance(obj, (DatetimeIndex, PeriodIndex)):
3939
return
4040
if op == "freq" and isinstance(obj, TimedeltaIndex):
41-
return
41+
pytest.skip(f"{op} is available on {type(obj)}")
4242

4343
with pytest.raises((AttributeError, TypeError)):
4444
getattr(obj, op)

pandas/tests/indexes/period/test_ops.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def test_invalid_ops_properties(self, op, index_or_series_obj):
2121
if isinstance(obj, (PeriodIndex, DatetimeIndex)):
2222
return
2323
if op == "freq" and isinstance(obj, TimedeltaIndex):
24-
return
24+
pytest.skip(f"{op} is available on {type(obj)}")
2525

2626
with pytest.raises((AttributeError, TypeError)):
2727
getattr(obj, op)

pandas/tests/indexes/timedeltas/test_ops.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def test_invalid_ops_properties(self, op, index_or_series_obj):
2626
if isinstance(obj, TimedeltaIndex):
2727
return
2828
if op == "freq" and isinstance(obj, (DatetimeIndex, PeriodIndex)):
29-
return
29+
pytest.skip(f"{op} is available on {type(obj)}")
3030

3131
with pytest.raises((AttributeError, TypeError)):
3232
getattr(obj, op)

0 commit comments

Comments
 (0)