Skip to content

TST: Unskip some Categorical Tests #23613

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 40 additions & 55 deletions pandas/tests/extension/test_categorical.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,80 +73,67 @@ class TestDtype(base.BaseDtypeTests):


class TestInterface(base.BaseInterfaceTests):
@pytest.mark.skip(reason="Memory usage doesn't match")
def test_memory_usage(self):
@pytest.mark.skip(reason="Memory usage doesn't match", strict=True)
def test_memory_usage(self, data):
# Is this deliberate?
pass
super(TestInterface, self).test_memory_usage(data)


class TestConstructors(base.BaseConstructorsTests):
pass


class TestReshaping(base.BaseReshapingTests):
@pytest.mark.skip(reason="Unobserved categories preseved in concat.")
def test_concat_columns(self, data, na_value):
pass

@pytest.mark.skip(reason="Unobserved categories preseved in concat.")
def test_align(self, data, na_value):
pass

@pytest.mark.skip(reason="Unobserved categories preseved in concat.")
def test_align_frame(self, data, na_value):
pass

@pytest.mark.skip(reason="Unobserved categories preseved in concat.")
def test_merge(self, data, na_value):
pass
pass


class TestGetitem(base.BaseGetitemTests):
skip_take = pytest.mark.skip(reason="GH-20664.")
skip_take = pytest.mark.skip(reason="GH-20664.", strict=True)

@pytest.mark.skip(reason="Backwards compatibility")
def test_getitem_scalar(self):
@pytest.mark.skip(reason="Backwards compatibility", strict=True)
def test_getitem_scalar(self, data):
# CategoricalDtype.type isn't "correct" since it should
# be a parent of the elements (object). But don't want
# to break things by changing.
pass
super(TestGetitem, self).test_getitem_scalar(data)

@skip_take
def test_take(self):
def test_take(self, data, na_value, na_cmp):
# TODO remove this once Categorical.take is fixed
pass
super(TestGetitem, self).test_take(data, na_value, na_cmp)

@skip_take
def test_take_negative(self):
pass
def test_take_negative(self, data):
super().test_take_negative(data)

@skip_take
def test_take_pandas_style_negative_raises(self):
pass
def test_take_pandas_style_negative_raises(self, data, na_value):
super().test_take_pandas_style_negative_raises(data, na_value)

@skip_take
def test_take_non_na_fill_value(self):
pass
def test_take_non_na_fill_value(self, data_missing):
super().test_take_non_na_fill_value(data_missing)

@skip_take
def test_take_out_of_bounds_raises(self):
pass
def test_take_out_of_bounds_raises(self, data, allow_fill):
return super().test_take_out_of_bounds_raises(data, allow_fill)

@pytest.mark.skip(reason="GH-20747. Unobserved categories.")
def test_take_series(self):
pass
@pytest.mark.skip(reason="GH-20747. Unobserved categories.", strict=True)
def test_take_series(self, data):
super().test_take_series(data)

@skip_take
def test_reindex_non_na_fill_value(self):
pass
def test_reindex_non_na_fill_value(self, data_missing):
super().test_reindex_non_na_fill_value(data_missing)

@pytest.mark.skip(reason="Categorical.take buggy")
def test_take_empty(self):
pass
@pytest.mark.skip(reason="Categorical.take buggy", strict=True)
def test_take_empty(self, data, na_value, na_cmp):
super().test_take_empty(data, na_value, na_cmp)

@pytest.mark.skip(reason="test not written correctly for categorical")
def test_reindex(self):
pass
@pytest.mark.skip(reason="test not written correctly for categorical",
strict=True)
def test_reindex(self, data, na_value):
super().test_reindex(data, na_value)


class TestSetitem(base.BaseSetitemTests):
Expand All @@ -155,25 +142,23 @@ class TestSetitem(base.BaseSetitemTests):

class TestMissing(base.BaseMissingTests):

@pytest.mark.skip(reason="Not implemented")
def test_fillna_limit_pad(self):
pass
@pytest.mark.skip(reason="Not implemented", strict=True)
def test_fillna_limit_pad(self, data_missing):
super().test_fillna_limit_pad(data_missing)

@pytest.mark.skip(reason="Not implemented")
def test_fillna_limit_backfill(self):
pass
@pytest.mark.skip(reason="Not implemented", strict=True)
def test_fillna_limit_backfill(self, data_missing):
super().test_fillna_limit_backfill(data_missing)


class TestReduce(base.BaseNoReduceTests):
pass


class TestMethods(base.BaseMethodsTests):
pass

@pytest.mark.skip(reason="Unobserved categories included")
@pytest.mark.skip(reason="Unobserved categories included", strict=True)
def test_value_counts(self, all_data, dropna):
pass
return super().test_value_counts(all_data, dropna)

def test_combine_add(self, data_repeated):
# GH 20825
Expand All @@ -191,9 +176,9 @@ def test_combine_add(self, data_repeated):
expected = pd.Series([a + val for a in list(orig_data1)])
self.assert_series_equal(result, expected)

@pytest.mark.skip(reason="Not Applicable")
@pytest.mark.skip(reason="Not Applicable", strict=True)
def test_fillna_length_mismatch(self, data_missing):
pass
super().test_fillna_length_mismatch(data_missing)


class TestCasting(base.BaseCastingTests):
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ known_post_core=pandas.tseries,pandas.io,pandas.plotting
sections=FUTURE,STDLIB,THIRDPARTY,PRE_CORE,DTYPES,FIRSTPARTY,POST_CORE,LOCALFOLDER

known_first_party=pandas
known_third_party=Cython,numpy,python-dateutil,pytz,pyarrow
known_third_party=Cython,numpy,python-dateutil,pytz,pyarrow,pytest
multi_line_output=4
force_grid_wrap=0
combine_as_imports=True
Expand Down