Skip to content

Commit c6108ec

Browse files
committed
More refinements
1 parent e5b7e57 commit c6108ec

File tree

4 files changed

+6
-14
lines changed

4 files changed

+6
-14
lines changed

pandas/tests/arrays/integer/test_arithmetic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ def test_reduce_to_float(op):
287287

288288
# op
289289
result = getattr(df.C, op)()
290-
assert isinstance(result, float)
290+
assert type(result) == float
291291

292292
# groupby
293293
result = getattr(df.groupby("A"), op)()

pandas/tests/series/methods/test_item.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def test_item(self):
2424

2525
ser = Series([0.5], index=[3])
2626
result = ser.item()
27-
assert isinstance(result, float)
27+
assert type(result) == float
2828
assert result == 0.5
2929

3030
ser = Series([1, 2])

pandas/tests/test_nanops.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1283,7 +1283,7 @@ def test_nanmean_overflow(disable_bottleneck, val, using_python_scalars):
12831283
result = ser.mean()
12841284
assert result == val
12851285
if using_python_scalars:
1286-
assert isinstance(result, float)
1286+
assert type(result) == float
12871287
else:
12881288
np_result = ser.values.mean()
12891289
assert result == np_result
@@ -1312,7 +1312,7 @@ def test_returned_dtype(disable_bottleneck, dtype, method, using_python_scalars)
13121312
if is_integer_dtype(dtype) and method in ["min", "max"]:
13131313
assert isinstance(result, int)
13141314
else:
1315-
assert isinstance(result, float)
1315+
assert type(result) == float
13161316
elif is_integer_dtype(dtype) and method not in ["min", "max"]:
13171317
assert result.dtype == np.float64
13181318
else:

pandas/tests/window/moments/test_moments_consistency_rolling.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,16 @@
11
import numpy as np
22
import pytest
33

4-
from pandas._config import using_python_scalars
5-
64
from pandas import Series
75
import pandas._testing as tm
86

97

108
def no_nans(x):
11-
if using_python_scalars() and isinstance(x, Series):
12-
return x.notna().all()
13-
else:
14-
return x.notna().all().all()
9+
return x.notna().all(axis=None)
1510

1611

1712
def all_na(x):
18-
if using_python_scalars() and isinstance(x, Series):
19-
return x.isnull().all()
20-
else:
21-
return x.isnull().all().all()
13+
return x.isnull().all(axis=None)
2214

2315

2416
@pytest.fixture(params=[(1, 0), (5, 1)])

0 commit comments

Comments
 (0)