|
3 | 3 |
|
4 | 4 | import pytest |
5 | 5 |
|
| 6 | +if sys.version_info >= (3, 9): # prevent mypy errors |
6 | 7 |
|
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 |
10 | 11 |
|
11 | | - from basedtyping.runtime_only import LiteralType |
| 12 | + from basedtyping.runtime_only import LiteralType |
12 | 13 |
|
13 | | - assert isinstance(Literal[1, 2], LiteralType) |
| 14 | + assert isinstance(Literal[1, 2], LiteralType) |
14 | 15 |
|
| 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 |
15 | 19 |
|
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