mirror of
https://github.com/qurator-spk/eynollah.git
synced 2025-07-05 00:49:57 +02:00
more code formatting
This commit is contained in:
parent
713b90e084
commit
1a95bca22d
24 changed files with 1408 additions and 1319 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue