Skip to content

Commit 1fb798c

Browse files
committed
!squash test does this work with LooseVersion
1 parent e3a44a0 commit 1fb798c

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

tests/test_version.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88

99
if t.TYPE_CHECKING:
1010
from _pytest.python_api import RaisesContext
11+
from typing_extensions import TypeAlias
12+
13+
VersionCompareOp: TypeAlias = t.Callable[
14+
[t.Any, t.Any],
15+
bool,
16+
]
1117

1218

1319
@pytest.mark.parametrize(
@@ -27,15 +33,9 @@ def test_version(version: str) -> None:
2733
assert LooseVersion(version)
2834

2935

30-
VersionCompareOp: t.TypeAlias = t.Callable[
31-
[t.Any, t.Any],
32-
bool,
33-
]
34-
35-
3636
class VersionCompareFixture(t.NamedTuple):
3737
a: object
38-
op: VersionCompareOp
38+
op: "VersionCompareOp"
3939
b: object
4040
raises: t.Union[t.Type[Exception], bool]
4141

@@ -57,7 +57,7 @@ class VersionCompareFixture(t.NamedTuple):
5757
)
5858
def test_version_compare(
5959
a: str,
60-
op: t.Callable[[object, object], bool],
60+
op: "VersionCompareOp",
6161
b: str,
6262
raises: t.Union[t.Type[Exception], bool],
6363
) -> None:

0 commit comments

Comments
 (0)