File: test_pep695.py

package info (click to toggle)
python-ast-decompiler 0.8.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 228 kB
  • sloc: python: 1,738; makefile: 3
file content (31 lines) | stat: -rw-r--r-- 456 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from .tests import check, skip_before


@skip_before((3, 12))
def test_generic_class() -> None:
    check(
        """
class C[T: int, *Ts, **P]:
    pass
"""
    )


@skip_before((3, 12))
def test_generic_function() -> None:
    check(
        """
def f[T: int, *Ts, **P](a: T, b: Ts, c: P) -> None:
    pass
"""
    )


@skip_before((3, 12))
def test_type_alias() -> None:
    check(
        """
type X = int
type Y[T: (int, str), *Ts, *P] = T
"""
    )