Skip to content

Commit cd6ad14

Browse files
committed
fix mypy errors on LiteralType tests in <3.9
1 parent 3840c38 commit cd6ad14

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

tests/test_runtime_only/test_literal_type.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@
33

44
import pytest
55

6+
if sys.version_info >= (3, 9): # prevent mypy errors
67

7-
@pytest.mark.skipif(sys.version_info < (3, 9), reason="need 3.9 for LiteralType")
8-
def test_literal_type_positive() -> None:
9-
from typing import Literal
8+
@pytest.mark.skipif(sys.version_info < (3, 9), reason="need 3.9 for LiteralType")
9+
def test_literal_type_positive() -> None:
10+
from typing import Literal
1011

11-
from basedtyping.runtime_only import LiteralType
12+
from basedtyping.runtime_only import LiteralType
1213

13-
assert isinstance(Literal[1, 2], LiteralType)
14+
assert isinstance(Literal[1, 2], LiteralType)
1415

16+
@pytest.mark.skipif(sys.version_info < (3, 9), reason="need 3.9 for LiteralType")
17+
def test_literal_type_negative() -> None:
18+
from basedtyping.runtime_only import LiteralType
1519

16-
@pytest.mark.skipif(sys.version_info < (3, 9), reason="need 3.9 for LiteralType")
17-
def test_literal_type_negative() -> None:
18-
from basedtyping.runtime_only import LiteralType
19-
20-
assert not isinstance(Union[int, str], LiteralType)
20+
assert not isinstance(Union[int, str], LiteralType)

0 commit comments

Comments
 (0)