From: Eugene Crosser Date: Mon, 30 May 2022 22:53:46 +0000 (+0200) Subject: adjust tests X-Git-Tag: 0.96.1 X-Git-Url: http://www.average.org/gitweb/?p=loctrkd.git;a=commitdiff_plain;h=fbfea100098be93421dc9ad4ba60524b86ac6770 adjust tests --- diff --git a/test/test_black.py b/test/test_black.py index 519bc23..4c34a77 100644 --- a/test/test_black.py +++ b/test/test_black.py @@ -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 = ( diff --git a/test/test_mypy.py b/test/test_mypy.py index 3b8eaaf..08f2c5e 100644 --- a/test/test_mypy.py +++ b/test/test_mypy.py @@ -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")