Skip to content

Commit 57480bd

Browse files
Update test_operators.py
1 parent 3b4a42a commit 57480bd

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

pandas/tests/arrays/categorical/test_operators.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -195,12 +195,13 @@ def test_comparison_of_ordered_categorical_with_nan_to_scalar(
195195

196196
cat = Categorical([1, 2, 3, None], categories=[1, 2, 3], ordered=True)
197197
scalar = 2
198+
198199
with warnings.catch_warnings():
199200
warnings.simplefilter("ignore", RuntimeWarning)
200-
actual = getattr(cat, compare_operators_no_eq_ne)(scalar)
201201
expected = getattr(np.array(cat),
202202
compare_operators_no_eq_ne)(scalar)
203-
tm.assert_numpy_array_equal(actual, expected)
203+
actual = getattr(cat, compare_operators_no_eq_ne)(scalar)
204+
tm.assert_numpy_array_equal(actual, expected)
204205

205206
def test_comparison_of_ordered_categorical_with_nan_to_listlike(
206207
self, compare_operators_no_eq_ne):
@@ -210,11 +211,12 @@ def test_comparison_of_ordered_categorical_with_nan_to_listlike(
210211

211212
cat = Categorical([1, 2, 3, None], categories=[1, 2, 3], ordered=True)
212213
other = Categorical([2, 2, 2, 2], categories=[1, 2, 3], ordered=True)
214+
213215
with warnings.catch_warnings():
214216
warnings.simplefilter("ignore", RuntimeWarning)
215-
actual = getattr(cat, compare_operators_no_eq_ne)(other)
216217
expected = getattr(np.array(cat), compare_operators_no_eq_ne)(2)
217-
tm.assert_numpy_array_equal(actual, expected)
218+
actual = getattr(cat, compare_operators_no_eq_ne)(other)
219+
tm.assert_numpy_array_equal(actual, expected)
218220

219221
@pytest.mark.parametrize('data,reverse,base', [
220222
(list("abc"), list("cba"), list("bbb")),

0 commit comments

Comments
 (0)