From 7ab818530b204c12fc52333c8b3892c09941fbe7 Mon Sep 17 00:00:00 2001 From: Martin Winkel Date: Sun, 9 Feb 2020 22:10:30 +0100 Subject: [PATCH] fixed mypy errors in pandas.tests.extension.json.test_json --- pandas/tests/extension/json/test_json.py | 10 ++++++---- setup.cfg | 3 --- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/pandas/tests/extension/json/test_json.py b/pandas/tests/extension/json/test_json.py index dc03a1f1dcf72..f7ca99be2adea 100644 --- a/pandas/tests/extension/json/test_json.py +++ b/pandas/tests/extension/json/test_json.py @@ -79,7 +79,8 @@ class BaseJSON: # The default assert_series_equal eventually does a # Series.values, which raises. We work around it by # converting the UserDicts to dicts. - def assert_series_equal(self, left, right, **kwargs): + @classmethod + def assert_series_equal(cls, left, right, *args, **kwargs): if left.dtype.name == "json": assert left.dtype == right.dtype left = pd.Series( @@ -90,9 +91,10 @@ def assert_series_equal(self, left, right, **kwargs): index=right.index, name=right.name, ) - tm.assert_series_equal(left, right, **kwargs) + tm.assert_series_equal(left, right, *args, **kwargs) - def assert_frame_equal(self, left, right, *args, **kwargs): + @classmethod + def assert_frame_equal(cls, left, right, *args, **kwargs): obj_type = kwargs.get("obj", "DataFrame") tm.assert_index_equal( left.columns, @@ -107,7 +109,7 @@ def assert_frame_equal(self, left, right, *args, **kwargs): jsons = (left.dtypes == "json").index for col in jsons: - self.assert_series_equal(left[col], right[col], *args, **kwargs) + cls.assert_series_equal(left[col], right[col], *args, **kwargs) left = left.drop(columns=jsons) right = right.drop(columns=jsons) diff --git a/setup.cfg b/setup.cfg index 9be09ae1076bb..4a900e581c353 100644 --- a/setup.cfg +++ b/setup.cfg @@ -135,9 +135,6 @@ ignore_errors=True [mypy-pandas.tests.arithmetic.test_datetime64] ignore_errors=True -[mypy-pandas.tests.extension.json.test_json] -ignore_errors=True - [mypy-pandas.tests.indexes.datetimes.test_tools] ignore_errors=True