Skip to content

Commit

Permalink
TST: Update union_categorical tests
Browse files Browse the repository at this point in the history
This relied on `NaN` being a float and empty being a float. Not a necessary
test anymore.
  • Loading branch information
TomAugspurger committed Aug 14, 2017
1 parent 273e6c8 commit b29279f
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions pandas/tests/reshape/test_union_categoricals.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,17 +107,11 @@ def test_union_categoricals_empty(self):
exp = Categorical([])
tm.assert_categorical_equal(res, exp)

res = union_categoricals([pd.Categorical([]),
pd.Categorical([1.0])])
exp = Categorical([1.0])
res = union_categoricals([Categorical([]),
Categorical(['1'])])
exp = Categorical(['1'])
tm.assert_categorical_equal(res, exp)

# to make dtype equal
nanc = pd.Categorical(np.array([np.nan], dtype=np.float64))
res = union_categoricals([nanc,
pd.Categorical([])])
tm.assert_categorical_equal(res, nanc)

def test_union_categorical_same_category(self):
# check fastpath
c1 = Categorical([1, 2, 3, 4], categories=[1, 2, 3, 4])
Expand Down

0 comments on commit b29279f

Please sign in to comment.