Skip to content

Commit 44be314

Browse files
committed
Added lost tests, renamed funcs
1 parent fc0c726 commit 44be314

File tree

3 files changed

+20
-5
lines changed

3 files changed

+20
-5
lines changed

pandas/tests/frame/test_indexing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3079,7 +3079,7 @@ def test_transpose(self):
30793079
assert_frame_equal(result, expected)
30803080

30813081

3082-
class DataFrameIndexingCategorical(object):
3082+
class TestDataFrameIndexingCategorical(object):
30833083

30843084
def test_assignment(self):
30853085
# assignment

pandas/tests/frame/test_repr_info.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import numpy as np
1111
import pytest
1212

13-
from pandas import (DataFrame, compat, option_context)
13+
from pandas import (DataFrame, Series, compat, option_context)
1414
from pandas.compat import StringIO, lrange, u, PYPY
1515
import pandas.io.formats.format as fmt
1616
import pandas as pd
@@ -471,3 +471,18 @@ def test_info_categorical(self):
471471

472472
buf = StringIO()
473473
df.info(buf=buf)
474+
475+
def test_info_categorical_column(self):
476+
477+
# make sure it works
478+
n = 2500
479+
df = DataFrame({'int64': np.random.randint(100, size=n)})
480+
df['category'] = Series(np.array(list('abcdefghij')).take(
481+
np.random.randint(0, 10, size=n))).astype('category')
482+
df.isna()
483+
buf = StringIO()
484+
df.info(buf=buf)
485+
486+
df2 = df[df['category'] == 'd']
487+
buf = compat.StringIO()
488+
df2.info(buf=buf)

pandas/tests/indexing/test_categorical.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def test_slicing_directly(self):
8787
tm.assert_numpy_array_equal(sliced._codes, expected._codes)
8888
tm.assert_index_equal(sliced.categories, expected.categories)
8989

90-
def test_block_slicing(self):
90+
def test_slicing(self):
9191
cat = Series(Categorical([1, 2, 3, 4]))
9292
reversed = cat[::-1]
9393
exp = np.array([4, 3, 2, 1], dtype=np.int64)
@@ -110,7 +110,7 @@ def test_block_slicing(self):
110110
result = df.loc[8]
111111
tm.assert_series_equal(result, expected)
112112

113-
def test_block_slicing_and_getting_ops(self):
113+
def test_slicing_and_getting_ops(self):
114114

115115
# systematically test the slicing operations:
116116
# for all slicing ops:
@@ -249,7 +249,7 @@ def test_block_slicing_and_getting_ops(self):
249249
tm.assert_frame_equal(res_df, df)
250250
assert is_categorical_dtype(res_df["cats"])
251251

252-
def test_block_slicing_doc_examples(self):
252+
def test_slicing_doc_examples(self):
253253

254254
# GH 7918
255255
cats = Categorical(["a", "b", "b", "b", "c", "c", "c"],

0 commit comments

Comments
 (0)