Skip to content

Commit 0c9d4b5

Browse files
Fix mypy error message in pandas/tests/indexes/test_numeric.py
Use Optional to signal that the value may be either an `Index` or `None`.
1 parent 18a9e4c commit 0c9d4b5

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

pandas/tests/indexes/common.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import gc
2+
from typing import Optional, Type
23

34
import numpy as np
45
import pytest
@@ -30,7 +31,7 @@
3031
class Base:
3132
""" base class for index sub-class tests """
3233

33-
_holder = None
34+
_holder: Optional[Type[Index]] = None
3435
_compat_props = ["shape", "ndim", "size", "nbytes"]
3536

3637
def test_pickle_compat_construction(self):

setup.cfg

-3
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,6 @@ ignore_errors=True
187187
[mypy-pandas.tests.indexes.test_category]
188188
ignore_errors=True
189189

190-
[mypy-pandas.tests.indexes.test_numeric]
191-
ignore_errors=True
192-
193190
[mypy-pandas.tests.indexes.test_range]
194191
ignore_errors=True
195192

0 commit comments

Comments
 (0)