summaryrefslogtreecommitdiff
path: root/tests/functional/u/unsupported/unsupported_version_for_final.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/functional/u/unsupported/unsupported_version_for_final.py')
-rw-r--r--tests/functional/u/unsupported/unsupported_version_for_final.py36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/functional/u/unsupported/unsupported_version_for_final.py b/tests/functional/u/unsupported/unsupported_version_for_final.py
new file mode 100644
index 000000000..efc433dd4
--- /dev/null
+++ b/tests/functional/u/unsupported/unsupported_version_for_final.py
@@ -0,0 +1,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