aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/tests
diff options
context:
space:
mode:
authorChristian Tismer <tismer@stackless.com>2024-11-08 12:30:52 +0100
committerChristian Tismer <tismer@stackless.com>2024-11-08 20:05:01 +0100
commit1ef1fefc26038a80ba81a860cff5024db44dca37 (patch)
treea24ca8deae268b6b0071020ab21c1c1820543027 /sources/pyside6/tests
parent3ea6979779ec7c51742233d4a384cdb5aad86490 (diff)
type hints: add __hash__, fix __copy__, __repr__ and __dir__
The other missing things are sequence and mapping methods which need some more support from cppgenerator. Will be added later. typing.Self is only known since Python 3.11 . We emulate that by patching it into typing and adjusting the Python version for mypy. Task-number: PYSIDE-2846 Change-Id: Icb1060c7bba355061d8f134c8e76fb14369d7dda Pick-to: 6.8 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/pyside6/tests')
-rw-r--r--sources/pyside6/tests/pysidetest/mypy_correctness_test.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/sources/pyside6/tests/pysidetest/mypy_correctness_test.py b/sources/pyside6/tests/pysidetest/mypy_correctness_test.py
index 5f94f82ab..fd253095b 100644
--- a/sources/pyside6/tests/pysidetest/mypy_correctness_test.py
+++ b/sources/pyside6/tests/pysidetest/mypy_correctness_test.py
@@ -52,7 +52,9 @@ class MypyCorrectnessTest(unittest.TestCase):
def testMypy(self):
self.assertTrue(HAVE_MYPY)
- cmd = [sys.executable, "-m", "mypy", "--cache-dir", self.cache_dir, self.pyside_dir]
+ insert_version = ["--python-version", "3.11"] if sys.version_info[:2] < (3, 11) else []
+ cmd = ([sys.executable, "-m", "mypy", "--cache-dir", self.cache_dir]
+ + insert_version + [self.pyside_dir])
time_pre = time.time()
ret = subprocess.run(cmd, capture_output=True)
time_post = time.time()