Skip to content

Commit 1ec162b

Browse files
author
dcreekp
committed
TST: remove redundant strict=True parameter (GH23057)
1 parent b0f16aa commit 1ec162b

33 files changed

+61
-93
lines changed

pandas/tests/arithmetic/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def box(request):
162162
@pytest.fixture(params=[pd.Index,
163163
pd.Series,
164164
pytest.param(pd.DataFrame,
165-
marks=pytest.mark.xfail(strict=True))],
165+
marks=pytest.mark.xfail)],
166166
ids=id_func)
167167
def box_df_fail(request):
168168
"""
@@ -175,7 +175,7 @@ def box_df_fail(request):
175175
(pd.Series, False),
176176
(pd.DataFrame, False),
177177
pytest.param((pd.DataFrame, True),
178-
marks=pytest.mark.xfail(strict=True))],
178+
marks=pytest.mark.xfail)],
179179
ids=id_func)
180180
def box_transpose_fail(request):
181181
"""

pandas/tests/arithmetic/test_numeric.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ class TestMultiplicationDivision(object):
407407
pytest.param(pd.Index,
408408
marks=pytest.mark.xfail(reason="Index.__div__ always "
409409
"raises",
410-
raises=TypeError, strict=True)),
410+
raises=TypeError)),
411411
pd.Series,
412412
pd.DataFrame
413413
], ids=lambda x: x.__name__)

pandas/tests/arithmetic/test_object.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def test_add_extension_scalar(self, other, box, op):
9292
@pytest.mark.parametrize('box', [
9393
pytest.param(pd.Index,
9494
marks=pytest.mark.xfail(reason="Does not mask nulls",
95-
strict=True, raises=TypeError)),
95+
raises=TypeError)),
9696
pd.Series,
9797
pd.DataFrame
9898
], ids=lambda x: x.__name__)
@@ -109,7 +109,7 @@ def test_objarr_add_str(self, box):
109109
@pytest.mark.parametrize('box', [
110110
pytest.param(pd.Index,
111111
marks=pytest.mark.xfail(reason="Does not mask nulls",
112-
strict=True, raises=TypeError)),
112+
raises=TypeError)),
113113
pd.Series,
114114
pd.DataFrame
115115
], ids=lambda x: x.__name__)

pandas/tests/arrays/categorical/test_constructors.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -538,8 +538,7 @@ def test_construction_with_ordered(self):
538538
cat = Categorical([0, 1, 2], ordered=True)
539539
assert cat.ordered
540540

541-
@pytest.mark.xfail(reason="Imaginary values not supported in Categorical",
542-
strict=True)
541+
@pytest.mark.xfail(reason="Imaginary values not supported in Categorical")
543542
def test_constructor_imaginary(self):
544543
values = [1, 2, 3 + 1j]
545544
c1 = Categorical(values)

pandas/tests/arrays/sparse/test_array.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ def test_astype_all(self, any_real_dtype):
488488
SparseArray(np.array([0, 1], dtype='datetime64[ns]'),
489489
dtype=SparseDtype('datetime64[ns]',
490490
pd.Timestamp('1970'))),
491-
marks=[pytest.mark.xfail(reason="NumPy-7619", strict=True)],
491+
marks=[pytest.mark.xfail(reason="NumPy-7619")],
492492
),
493493
(SparseArray([0, 1, 10]), str,
494494
SparseArray(['0', '1', '10'], dtype=SparseDtype(str, '0'))),

pandas/tests/extension/base/ops.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ def test_arith_series_with_scalar(self, data, all_arithmetic_operators):
7272
s = pd.Series(data)
7373
self.check_opname(s, op_name, s.iloc[0], exc=self.series_scalar_exc)
7474

75-
@pytest.mark.xfail(run=False, reason="_reduce needs implementation",
76-
strict=True)
75+
@pytest.mark.xfail(run=False, reason="_reduce needs implementation")
7776
def test_arith_frame_with_scalar(self, data, all_arithmetic_operators):
7877
# frame & scalar
7978
op_name = all_arithmetic_operators

pandas/tests/extension/base/setitem.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,7 @@ def test_setitem_frame_invalid_length(self, data):
166166
with pytest.raises(ValueError, match=xpr):
167167
df['B'] = data[:5]
168168

169-
@pytest.mark.xfail(reason="GH#20441: setitem on extension types.",
170-
strict=True)
169+
@pytest.mark.xfail(reason="GH#20441: setitem on extension types.")
171170
def test_setitem_tuple_index(self, data):
172171
s = pd.Series(data[:2], index=[(0, 0), (0, 1)])
173172
expected = pd.Series(data.take([1, 1]), index=s.index)

pandas/tests/extension/json/test_json.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def test_stack(self):
148148
rows since we consider `{}` NA, but `.astype(object)` doesn't.
149149
"""
150150

151-
@pytest.mark.xfail(reason="dict for NA", strict=True)
151+
@pytest.mark.xfail(reason="dict for NA")
152152
def test_unstack(self, data, index):
153153
# The base test has NaN for the expected NA value.
154154
# this matches otherwise

pandas/tests/extension/test_categorical.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class TestDtype(base.BaseDtypeTests):
7272

7373

7474
class TestInterface(base.BaseInterfaceTests):
75-
@pytest.mark.skip(reason="Memory usage doesn't match", strict=True)
75+
@pytest.mark.skip(reason="Memory usage doesn't match")
7676
def test_memory_usage(self, data):
7777
# Is this deliberate?
7878
super(TestInterface, self).test_memory_usage(data)
@@ -87,9 +87,9 @@ class TestReshaping(base.BaseReshapingTests):
8787

8888

8989
class TestGetitem(base.BaseGetitemTests):
90-
skip_take = pytest.mark.skip(reason="GH-20664.", strict=True)
90+
skip_take = pytest.mark.skip(reason="GH-20664.")
9191

92-
@pytest.mark.skip(reason="Backwards compatibility", strict=True)
92+
@pytest.mark.skip(reason="Backwards compatibility")
9393
def test_getitem_scalar(self, data):
9494
# CategoricalDtype.type isn't "correct" since it should
9595
# be a parent of the elements (object). But don't want
@@ -117,20 +117,19 @@ def test_take_non_na_fill_value(self, data_missing):
117117
def test_take_out_of_bounds_raises(self, data, allow_fill):
118118
return super().test_take_out_of_bounds_raises(data, allow_fill)
119119

120-
@pytest.mark.skip(reason="GH-20747. Unobserved categories.", strict=True)
120+
@pytest.mark.skip(reason="GH-20747. Unobserved categories.")
121121
def test_take_series(self, data):
122122
super().test_take_series(data)
123123

124124
@skip_take
125125
def test_reindex_non_na_fill_value(self, data_missing):
126126
super().test_reindex_non_na_fill_value(data_missing)
127127

128-
@pytest.mark.skip(reason="Categorical.take buggy", strict=True)
128+
@pytest.mark.skip(reason="Categorical.take buggy")
129129
def test_take_empty(self, data, na_value, na_cmp):
130130
super().test_take_empty(data, na_value, na_cmp)
131131

132-
@pytest.mark.skip(reason="test not written correctly for categorical",
133-
strict=True)
132+
@pytest.mark.skip(reason="test not written correctly for categorical")
134133
def test_reindex(self, data, na_value):
135134
super().test_reindex(data, na_value)
136135

@@ -141,11 +140,11 @@ class TestSetitem(base.BaseSetitemTests):
141140

142141
class TestMissing(base.BaseMissingTests):
143142

144-
@pytest.mark.skip(reason="Not implemented", strict=True)
143+
@pytest.mark.skip(reason="Not implemented")
145144
def test_fillna_limit_pad(self, data_missing):
146145
super().test_fillna_limit_pad(data_missing)
147146

148-
@pytest.mark.skip(reason="Not implemented", strict=True)
147+
@pytest.mark.skip(reason="Not implemented")
149148
def test_fillna_limit_backfill(self, data_missing):
150149
super().test_fillna_limit_backfill(data_missing)
151150

@@ -155,7 +154,7 @@ class TestReduce(base.BaseNoReduceTests):
155154

156155

157156
class TestMethods(base.BaseMethodsTests):
158-
@pytest.mark.skip(reason="Unobserved categories included", strict=True)
157+
@pytest.mark.skip(reason="Unobserved categories included")
159158
def test_value_counts(self, all_data, dropna):
160159
return super().test_value_counts(all_data, dropna)
161160

@@ -175,7 +174,7 @@ def test_combine_add(self, data_repeated):
175174
expected = pd.Series([a + val for a in list(orig_data1)])
176175
self.assert_series_equal(result, expected)
177176

178-
@pytest.mark.skip(reason="Not Applicable", strict=True)
177+
@pytest.mark.skip(reason="Not Applicable")
179178
def test_fillna_length_mismatch(self, data_missing):
180179
super().test_fillna_length_mismatch(data_missing)
181180

pandas/tests/frame/test_combine_concat.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,7 @@ def test_concat_multiple_tzs(self):
7777
[
7878
'2015-01-01',
7979
pytest.param(pd.NaT, marks=pytest.mark.xfail(
80-
reason='GH23037 incorrect dtype when concatenating',
81-
strict=True))])
80+
reason='GH23037 incorrect dtype when concatenating'))])
8281
def test_concat_tz_NaT(self, t1):
8382
# GH 22796
8483
# Concating tz-aware multicolumn DataFrames

0 commit comments

Comments
 (0)