Skip to content

Commit 74fc0cc

Browse files
committed
TST: tests for needs-test issues pandas-dev#12857, pandas-dev#12689
1 parent 2e4a024 commit 74fc0cc

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

pandas/tests/frame/test_arithmetic.py

+7
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@
1616
class TestFrameComparisons:
1717
# Specifically _not_ flex-comparisons
1818

19+
def test_frame_in_list(self):
20+
# GH#12689 this should raise at the DataFrame level, not blocks
21+
df = pd.DataFrame(np.random.randn(6,4), columns=list('ABCD'))
22+
msg = "The truth value of a DataFrame is ambiguous"
23+
with pytest.raises(ValueError, match=msg):
24+
df in [None]
25+
1926
def test_comparison_invalid(self):
2027
def check(df, df2):
2128

pandas/tests/frame/test_repr_info.py

+12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from datetime import datetime, timedelta
22
from io import StringIO
3+
import random
34
import re
45
import sys
56
import textwrap
@@ -27,6 +28,17 @@
2728

2829

2930
class TestDataFrameReprInfoEtc:
31+
32+
def test_repr_bytes_61_lines(self):
33+
# GH#12857
34+
lets = 'ACDEFGHIJKLMNOP'
35+
slen = 50
36+
nseqs = 1000
37+
words = [[random.choice(lets) for x in range(slen)] for _ in range(nseqs)]
38+
df = pd.DataFrame(words).astype('S1')
39+
assert (df.dtypes == 'S1').all()
40+
repr(df) # smoke test
41+
3042
def test_repr_empty(self):
3143
# empty
3244
foo = repr(DataFrame()) # noqa

0 commit comments

Comments
 (0)