From 84c11e46ef8ec36824b0d040972de37e41943b5d Mon Sep 17 00:00:00 2001 From: Eugene Crosser Date: Wed, 15 Jun 2022 23:57:04 +0200 Subject: [PATCH] test: make unittests individually runnable --- test/test_black.py | 6 +++++- test/test_mypy.py | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) 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() -- 2.39.2