From 9a00a354c2b9d2e471908165475e099cdbfc6c67 Mon Sep 17 00:00:00 2001 From: Monson Shao Date: Sat, 21 Jul 2018 17:53:58 +0800 Subject: [PATCH] frame: kill F821 error in test case --- pandas/tests/frame/test_dtypes.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pandas/tests/frame/test_dtypes.py b/pandas/tests/frame/test_dtypes.py index 76a50a9ecf5e7..30a670ead3aa0 100644 --- a/pandas/tests/frame/test_dtypes.py +++ b/pandas/tests/frame/test_dtypes.py @@ -9,7 +9,7 @@ import numpy as np from pandas import (DataFrame, Series, date_range, Timedelta, Timestamp, Categorical, compat, concat, option_context) -from pandas.compat import u, PY2 +from pandas.compat import u from pandas import _np_version_under1p14 from pandas.core.dtypes.dtypes import DatetimeTZDtype, CategoricalDtype @@ -356,9 +356,10 @@ def test_select_dtypes_datetime_with_tz(self): expected = df3.reindex(columns=[]) assert_frame_equal(result, expected) - @pytest.mark.parametrize( - "dtype", [str, "str", np.string_, "S1", - "unicode", np.unicode_, "U1"] + ([unicode] if PY2 else [])) + @pytest.mark.parametrize("dtype", [ + str, "str", np.string_, "S1", "unicode", np.unicode_, "U1", + compat.text_type + ]) @pytest.mark.parametrize("arg", ["include", "exclude"]) def test_select_dtypes_str_raises(self, dtype, arg): df = DataFrame({"a": list("abc"),