Skip to content

Commit

Permalink
TST: Unskip some Categorical Tests (pandas-dev#23613)
Browse files Browse the repository at this point in the history
  • Loading branch information
TomAugspurger authored and JustinZhengBC committed Nov 14, 2018
1 parent f2eac44 commit fef6d7a
Showing 1 changed file with 40 additions and 55 deletions.
95 changes: 40 additions & 55 deletions pandas/tests/extension/test_categorical.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,80 +72,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 @@ -154,25 +141,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 @@ -190,9 +175,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

0 comments on commit fef6d7a

Please sign in to comment.