def test_validate_categorical_dtype_bad_ser():
    # checks that TypeError is raised when df contains float data
    with pytest.raises(TypeError) as excinfo:
        cf._validate_categorical_dtype(bad_type['b1'])
    # verifies TypeError contains appropriate message
    assert 'should be of type object or int64' in str(excinfo.value)
def test_validate_categorical_dtype_good_ser():
    # verifies good data passes the dtype check
    cf._validate_categorical_dtype(good['g1'])