Skip to content

Commit dd097c3

Browse files
committed
tst: update test to test subclass of DataFrame
1 parent 48a4064 commit dd097c3

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

pandas/tests/dtypes/test_inference.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -238,16 +238,14 @@ def test_is_list_like_generic():
238238
# is_list_like was yielding false positives for Generic classes in python 3.11
239239
T = TypeVar("T")
240240

241-
class Base:
242-
def __init__(self, x: int):
243-
self._x = x
244-
245-
class Gen(Base, Generic[T]):
241+
class MyDataFrame(DataFrame, Generic[T]):
246242
...
247243

248-
fooc = Gen[float]
244+
tstc = MyDataFrame[int]
245+
tst = MyDataFrame[int]({"x": [1, 2, 3]})
249246

250-
assert not inference.is_list_like(fooc)
247+
assert not inference.is_list_like(tstc)
248+
assert isinstance(tst, DataFrame)
251249

252250

253251
def test_is_sequence():

0 commit comments

Comments
 (0)