Skip to content

Commit 5e80859

Browse files
committed
Switch to pandas Version
1 parent c6ce53c commit 5e80859

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tests/__init__.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@
1111
Final,
1212
)
1313

14-
from packaging.version import parse
1514
import pandas as pd
15+
from pandas.util.version import Version
1616
import pytest
1717

1818
from pandas._typing import T
1919

2020
TYPE_CHECKING_INVALID_USAGE: Final = TYPE_CHECKING
2121
WINDOWS = os.name == "nt" or "cygwin" in platform.system().lower()
22-
PD_LTE_15 = parse(pd.__version__) < parse("1.5.999")
22+
PD_LTE_15 = Version(pd.__version__) < Version("1.5.999")
2323

2424

2525
def check(actual: T, klass: type, dtype: type | None = None, attr: str = "left") -> T:
@@ -46,7 +46,7 @@ def pytest_warns_bounded(
4646
upper: str | None = None,
4747
) -> AbstractContextManager:
4848
"""
49-
Version conditional pytet.warns context manager
49+
Version conditional pytest.warns context manager
5050
5151
Returns a context manager that will raise an error if
5252
the warning is not issued when pandas version is
@@ -86,9 +86,9 @@ def pytest_warns_bounded(
8686
# Versions between 1.3.x and 1.5.x will raise an error
8787
pass
8888
"""
89-
lb = parse("0.0.0") if lower is None else parse(lower)
90-
ub = parse("9999.0.0") if upper is None else parse(upper)
91-
current = parse(pd.__version__)
89+
lb = Version("0.0.0") if lower is None else Version(lower)
90+
ub = Version("9999.0.0") if upper is None else Version(upper)
91+
current = Version(pd.__version__)
9292
if lb < current < ub:
9393
return pytest.warns(warning, match=match)
9494
else:

0 commit comments

Comments
 (0)