From ae0a7e92ec968fe58bbfbf00724d269996c26ebe Mon Sep 17 00:00:00 2001 From: saskakarsi <44523813+saskakarsi@users.noreply.github.com> Date: Thu, 17 Oct 2019 00:24:53 +0300 Subject: [PATCH] CLN: fix mypy error pandas/tests/plotting/test_backend.py (#29016) * CLN: fix mypy error pandas/tests/plotting/test_backend.py GH28926, mypy didn't like setting non-existant attribute on module. Dummy function, circumvented with __setattr__ --- pandas/tests/plotting/test_backend.py | 2 +- setup.cfg | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/pandas/tests/plotting/test_backend.py b/pandas/tests/plotting/test_backend.py index 6511d94aa4c094..41b1a88b15acb0 100644 --- a/pandas/tests/plotting/test_backend.py +++ b/pandas/tests/plotting/test_backend.py @@ -9,7 +9,7 @@ import pandas dummy_backend = types.ModuleType("pandas_dummy_backend") -dummy_backend.plot = lambda *args, **kwargs: None +setattr(dummy_backend, "plot", lambda *args, **kwargs: None) @pytest.fixture diff --git a/setup.cfg b/setup.cfg index ca15386b2c4299..4353c0065b94b1 100644 --- a/setup.cfg +++ b/setup.cfg @@ -202,9 +202,6 @@ ignore_errors=True [mypy-pandas.tests.io.json.test_ujson] ignore_errors=True -[mypy-pandas.tests.plotting.test_backend] -ignore_errors=True - [mypy-pandas.tests.series.test_constructors] ignore_errors=True