diff --git a/pandas/tests/strings/conftest.py b/pandas/tests/strings/conftest.py index 5bcbb16da3be9..122bebb517c9a 100644 --- a/pandas/tests/strings/conftest.py +++ b/pandas/tests/strings/conftest.py @@ -94,9 +94,10 @@ ], [()] * 100, [{}] * 100, + strict=False, ) ) -ids, _, _ = zip(*_any_string_method) # use method name as fixture-id +ids, _, _ = zip(*_any_string_method, strict=True) # use method name as fixture-id missing_methods = {f for f in dir(StringMethods) if not f.startswith("_")} - set(ids) # test that the above list captures all methods of StringMethods diff --git a/pandas/tests/strings/test_api.py b/pandas/tests/strings/test_api.py index 6b9df072019eb..470ece15fa536 100644 --- a/pandas/tests/strings/test_api.py +++ b/pandas/tests/strings/test_api.py @@ -21,7 +21,7 @@ ("empty", []), ("mixed-integer", ["a", np.nan, 2]), ] -ids, _ = zip(*_any_allowed_skipna_inferred_dtype) # use inferred type as id +ids, _ = zip(*_any_allowed_skipna_inferred_dtype, strict=True) # use inferred type as id @pytest.fixture(params=_any_allowed_skipna_inferred_dtype, ids=ids) diff --git a/pandas/tests/strings/test_strings.py b/pandas/tests/strings/test_strings.py index e07ece91090df..2ca5838283943 100644 --- a/pandas/tests/strings/test_strings.py +++ b/pandas/tests/strings/test_strings.py @@ -757,7 +757,7 @@ def test_cat_on_bytes_raises(): def test_str_accessor_in_apply_func(): # https://github.com/pandas-dev/pandas/issues/38979 - df = DataFrame(zip("abc", "def")) + df = DataFrame(zip("abc", "def", strict=True)) expected = Series(["A/D", "B/E", "C/F"]) result = df.apply(lambda f: "/".join(f.str.upper()), axis=1) tm.assert_series_equal(result, expected)