more code formatting

This commit is contained in:
cneud 2024-02-23 22:44:27 +01:00
parent 713b90e084
commit 1a95bca22d
24 changed files with 1408 additions and 1319 deletions

View file

@ -10,12 +10,14 @@ from unittest import TestCase as VanillaTestCase, skip, main as unittests_main
import pytest
from ocrd_utils import disableLogging, initLogging
def main(fn=None):
if fn:
sys.exit(pytest.main([fn]))
else:
unittests_main()
class TestCase(VanillaTestCase):
@classmethod
@ -26,6 +28,7 @@ class TestCase(VanillaTestCase):
disableLogging()
initLogging()
class CapturingTestCase(TestCase):
"""
A TestCase that needs to capture stderr/stdout and invoke click CLI.
@ -42,7 +45,7 @@ class CapturingTestCase(TestCase):
"""
self.capture_out_err() # XXX snapshot just before executing the CLI
code = 0
sys.argv[1:] = args # XXX necessary because sys.argv reflects pytest args not cli args
sys.argv[1:] = args # XXX necessary because sys.argv reflects pytest args not cli args
try:
cli.main(args=args)
except SystemExit as e: