Skip to content

Commit 9640482

Browse files
committed
TST: fixed invalid DataFrame() initializations in tests
1 parent 66caa72 commit 9640482

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

pandas/tests/indexes/test_multi.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -3066,8 +3066,7 @@ def test_nan_stays_float(self):
30663066
assert pd.isna(idx0.get_level_values(1)).all()
30673067
# the following failed in 0.14.1
30683068
assert pd.isna(idxm.get_level_values(1)[:-1]).all()
3069-
3070-
df0 = pd.DataFrame([[1, 2]], index=idx0)
3069+
df0 = pd.DataFrame([[1, 2]] * 2, index=idx0)
30713070
df1 = pd.DataFrame([[3, 4]], index=idx1)
30723071
dfm = df0 - df1
30733072
assert pd.isna(df0.index.get_level_values(1)).all()

pandas/tests/io/formats/test_style.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def setup_method(self, method):
2424

2525
def h(x, foo='bar'):
2626
return pd.Series(
27-
['color: {foo}'.format(foo=foo)], index=x.index, name=x.name)
27+
'color: {foo}'.format(foo=foo), index=x.index, name=x.name)
2828

2929
self.h = h
3030
self.styler = Styler(self.df)

pandas/tests/reshape/test_reshape.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ def test_preserve_categorical_dtype(self):
462462
cidx = pd.CategoricalIndex(list("xyz"), ordered=ordered)
463463
midx = pd.MultiIndex(levels=[['a'], cidx],
464464
labels=[[0, 0], [0, 1]])
465-
df = DataFrame([[10, 11]], index=midx)
465+
df = DataFrame([[10, 11]] * 2, index=midx, columns=[0, 1])
466466

467467
expected = DataFrame([[1.0, 0.0, 0.0], [0.0, 1.0, 0.0]],
468468
index=midx, columns=cidx)

0 commit comments

Comments
 (0)