From: Eugene Crosser Date: Wed, 15 Jun 2022 21:57:04 +0000 (+0200) Subject: test: make unittests individually runnable X-Git-Tag: 0.99~12 X-Git-Url: http://www.average.org/gitweb/?p=loctrkd.git;a=commitdiff_plain;h=84c11e46ef8ec36824b0d040972de37e41943b5d test: make unittests individually runnable --- diff --git a/test/test_black.py b/test/test_black.py index 7726207..cc72eae 100644 --- a/test/test_black.py +++ b/test/test_black.py @@ -3,7 +3,7 @@ from pkg_resources import get_distribution, DistributionNotFound from re import match from subprocess import run from shutil import which -from unittest import TestCase, skipUnless +from unittest import main, TestCase, skipUnless black_version = 0.0 try: @@ -33,3 +33,7 @@ class BlackFormatter(TestCase): self.fail( f"black exited with code {output.returncode}:\n{output.stderr.decode()}" ) + + +if __name__ == "__main__": + main() diff --git a/test/test_mypy.py b/test/test_mypy.py index d2020d4..d93f568 100644 --- a/test/test_mypy.py +++ b/test/test_mypy.py @@ -1,7 +1,7 @@ from pkg_resources import get_distribution, DistributionNotFound from subprocess import call from shutil import which -from unittest import skipUnless, TestCase +from unittest import main, skipUnless, TestCase mypy_version = 0.0 try: @@ -23,3 +23,7 @@ class TypeCheck(TestCase): "test", ] self.assertEqual(call(cmd), 0, "mypy typecheck") + + +if __name__ == "__main__": + main()