Skip to content

Commit 50c2cc3

Browse files
use LooseVersion
1 parent 7de12e7 commit 50c2cc3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pandas/tests/extension/test_numpy.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from distutils.version import LooseVersion
2+
13
import numpy as np
24
import pytest
35

@@ -8,8 +10,6 @@
810

911
from . import base
1012

11-
NP_VERSION_INFO = tuple(int(x) for x in np.__version__.split('.')[:2])
12-
1313

1414
@pytest.fixture(params=['float', 'object'])
1515
def dtype(request):
@@ -50,7 +50,7 @@ def data_missing(allow_in_pandas, dtype):
5050
# For NumPy <1.16, np.array([np.nan, (1,)]) raises
5151
# ValueError: setting an array element with a sequence.
5252
if dtype.numpy_dtype == 'object':
53-
if NP_VERSION_INFO < (1, 16):
53+
if LooseVersion(np.__version__) < LooseVersion("1.16"):
5454
raise pytest.skip("Skipping for NumPy <1.16")
5555
return PandasArray(np.array([np.nan, (1,)]))
5656
return PandasArray(np.array([np.nan, 1.0]))

0 commit comments

Comments
 (0)