]> www.average.org Git - loctrkd.git/commitdiff
typecheck: skip test if mypy verison < 0.942 0.96.2
authorEugene Crosser <crosser@average.org>
Mon, 30 May 2022 23:01:54 +0000 (01:01 +0200)
committerEugene Crosser <crosser@average.org>
Mon, 30 May 2022 23:01:54 +0000 (01:01 +0200)
test/test_mypy.py

index 08f2c5eefdc7b3ed1720d0ac70dfaa563936a99b..d2020d4ff7b2eb6f5abcf6b611395ba1e69c8d4f 100644 (file)
@@ -1,9 +1,17 @@
+from pkg_resources import get_distribution, DistributionNotFound
 from subprocess import call
 from shutil import which
-from unittest import TestCase
+from unittest import skipUnless, TestCase
+
+mypy_version = 0.0
+try:
+    mypy_version = float(get_distribution("mypy").version)
+except DistributionNotFound:
+    pass
 
 
 class TypeCheck(TestCase):
+    @skipUnless(mypy_version >= 0.942, "Do not trust earlier mypy versions")
     def test_mypy(self) -> None:
         if not which("mypy"):
             self.fail("mypy not installed.")