Skip to content

Commit 33beed8

Browse files
jbrockmendelvictor
authored and
victor
committed
Fix test_info_repr pandas-dev#21746 (pandas-dev#22223)
1 parent e2bda23 commit 33beed8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pandas/tests/io/formats/test_format.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -1586,8 +1586,12 @@ def test_repr_html_long_and_wide(self):
15861586
assert '...' in df._repr_html_()
15871587

15881588
def test_info_repr(self):
1589+
# GH#21746 For tests inside a terminal (i.e. not CI) we need to detect
1590+
# the terminal size to ensure that we try to print something "too big"
1591+
term_width, term_height = get_terminal_size()
1592+
15891593
max_rows = 60
1590-
max_cols = 20
1594+
max_cols = 20 + (max(term_width, 80) - 80) // 4
15911595
# Long
15921596
h, w = max_rows + 1, max_cols - 1
15931597
df = DataFrame({k: np.arange(1, 1 + h) for k in np.arange(w)})

0 commit comments

Comments
 (0)