make tests runnable without specifying subdirectory

This commit is contained in:
Vladimir Repin 2023-01-09 14:11:37 +03:00
parent 8850fc23b6
commit 1d663a04da

View File

@ -15,7 +15,7 @@ def run_tests(proc, test_dir):
break break
if proc.poll() is None: if proc.poll() is None:
if test_dir is None: if test_dir is None:
test_dir = "" test_dir = "test"
suite = unittest.TestLoader().discover(test_dir, pattern="*_test.py", top_level_dir="test") suite = unittest.TestLoader().discover(test_dir, pattern="*_test.py", top_level_dir="test")
result = unittest.TextTestRunner(verbosity=2).run(suite) result = unittest.TextTestRunner(verbosity=2).run(suite)
return len(result.failures) + len(result.errors) return len(result.failures) + len(result.errors)