Skip to content

Commit 00b3cd9

Browse files
committed
Add test
1 parent b0192c7 commit 00b3cd9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pandas/tests/io/formats/test_format.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,13 @@ def test_repr_truncation_dataframe_attrs(self):
136136
with option_context("display.max_columns", 2, "display.show_dimensions", False):
137137
assert repr(df) == " 0 ... 9\n0 0 ... 0"
138138

139+
def test_repr_truncation_series_with_dataframe_attrs(self):
140+
# GH#60568
141+
ser = Series([0] * 10)
142+
ser.attrs["b"] = DataFrame([])
143+
with option_context("display.max_rows", 2, "display.show_dimensions", False):
144+
assert repr(ser) == "0 0\n ..\n9 0\ndtype: int64"
145+
139146
def test_max_colwidth_negative_int_raises(self):
140147
# Deprecation enforced from:
141148
# https://github.com/pandas-dev/pandas/issues/31532

0 commit comments

Comments
 (0)