From 235a8be26e524dbb0d8efc350854f30f1be86d5e Mon Sep 17 00:00:00 2001 From: Jeroen Kant Date: Tue, 15 Oct 2019 01:06:18 +0200 Subject: [PATCH 1/2] CLN: Add type hinting in base classes (GH28926) --- pandas/tests/io/test_sql.py | 5 +++-- setup.cfg | 3 --- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/pandas/tests/io/test_sql.py b/pandas/tests/io/test_sql.py index 7491cef17ebfc..034dc5e511848 100644 --- a/pandas/tests/io/test_sql.py +++ b/pandas/tests/io/test_sql.py @@ -21,6 +21,7 @@ from datetime import date, datetime, time from io import StringIO import sqlite3 +from typing import Optional import warnings import numpy as np @@ -583,7 +584,7 @@ class _TestSQLApi(PandasSQLTest): """ flavor = "sqlite" - mode = None + mode = None # type: Optional[str] def setup_connect(self): self.conn = self.connect() @@ -1234,7 +1235,7 @@ class _TestSQLAlchemy(SQLAlchemyMixIn, PandasSQLTest): """ - flavor = None + flavor = None # type: Optional[str] @pytest.fixture(autouse=True, scope="class") def setup_class(cls): diff --git a/setup.cfg b/setup.cfg index 64494bf84363e..19775ff1d2725 100644 --- a/setup.cfg +++ b/setup.cfg @@ -208,9 +208,6 @@ ignore_errors=True [mypy-pandas.tests.io.parser.conftest] ignore_errors=True -[mypy-pandas.tests.io.test_sql] -ignore_errors=True - [mypy-pandas.tests.plotting.test_backend] ignore_errors=True From b03a2148e8991bc4c62376c53900c8b6a4d9d8e4 Mon Sep 17 00:00:00 2001 From: Jeroen Kant Date: Tue, 15 Oct 2019 01:43:49 +0200 Subject: [PATCH 2/2] CLN: Added type hints to test classes (GH28926) --- pandas/tests/io/test_sql.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandas/tests/io/test_sql.py b/pandas/tests/io/test_sql.py index 034dc5e511848..e7f10f1b5ab07 100644 --- a/pandas/tests/io/test_sql.py +++ b/pandas/tests/io/test_sql.py @@ -1838,7 +1838,7 @@ class _TestSQLiteAlchemy: """ - flavor = "sqlite" + flavor = "sqlite" # type: Optional[str] @classmethod def connect(cls): @@ -1887,7 +1887,7 @@ class _TestMySQLAlchemy: """ - flavor = "mysql" + flavor = "mysql" # type: Optional[str] @classmethod def connect(cls): @@ -1956,7 +1956,7 @@ class _TestPostgreSQLAlchemy: """ - flavor = "postgresql" + flavor = "postgresql" # type: Optional[str] @classmethod def connect(cls):