summaryrefslogtreecommitdiff
path: root/tests/functional/u/unsupported/unsupported_version_for_final.py
blob: efc433dd41a7ee0d5d8f8ca8c9af9837a2ebd076 (plain)
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
32
33
34
35
36
"""Tests for the use of typing.final whenever the py-version is set < 3.8"""
# pylint: disable=missing-class-docstring, no-member, too-few-public-methods, missing-function-docstring, no-name-in-module, reimported

import typing
import typing as mytyping
from typing import final
from typing import final as myfinal


@final  # [using-final-decorator-in-unsupported-version]
class MyClass1:
    @final  # [using-final-decorator-in-unsupported-version]
    @final  # [using-final-decorator-in-unsupported-version]
    def my_method(self):
        pass


@myfinal  # [using-final-decorator-in-unsupported-version]
class MyClass2:
    @myfinal  # [using-final-decorator-in-unsupported-version]
    def my_method(self):
        pass


@typing.final  # [using-final-decorator-in-unsupported-version]
class MyClass3:
    @typing.final  # [using-final-decorator-in-unsupported-version]
    def my_method(self):
        pass


@mytyping.final  # [using-final-decorator-in-unsupported-version]
class MyClass4:
    @mytyping.final  # [using-final-decorator-in-unsupported-version]
    def my_method(self):
        pass