]> www.average.org Git - loctrkd.git/commitdiff
adjust tests 0.96.1
authorEugene Crosser <crosser@average.org>
Mon, 30 May 2022 22:53:46 +0000 (00:53 +0200)
committerEugene Crosser <crosser@average.org>
Mon, 30 May 2022 22:53:46 +0000 (00:53 +0200)
test/test_black.py
test/test_mypy.py

index 519bc23deea55bdcbd3e80fdf6e96ec29f686641..4c34a770813414c8c2a48e8fcb93206374ac509e 100644 (file)
@@ -5,7 +5,7 @@ from unittest import TestCase
 
 
 class BlackFormatter(TestCase):
-    def test_black(self):
+    def test_black(self) -> None:
         if not which("black"):
             self.fail(f"black not installed.")
         cmd = (
index 3b8eaaf2368476e432f506988a5e7380bba60c58..08f2c5eefdc7b3ed1720d0ac70dfaa563936a99b 100644 (file)
@@ -1,15 +1,17 @@
-from subprocess import run
+from subprocess import call
 from shutil import which
 from unittest import TestCase
 
 
 class TypeCheck(TestCase):
-    def test_mypy(self):
+    def test_mypy(self) -> None:
         if not which("mypy"):
-            self.fail(f"mypy not installed.")
-        cmd = ["mypy", "--strict", "--ignore-missing-imports", "gps303"]
-        output = run(cmd, capture_output=True)
-        if output.returncode != 0:
-            self.fail(
-                f"mypy exited with code {output.returncode}:\n{output.stderr.decode()}"
-            )
+            self.fail("mypy not installed.")
+        cmd = [
+            "mypy",
+            "--strict",
+            "--ignore-missing-imports",
+            "gps303",
+            "test",
+        ]
+        self.assertEqual(call(cmd), 0, "mypy typecheck")