Skip to content

Commit

Permalink
tests: main with __file__ will invoke pytest.main, not unittests.main
Browse files Browse the repository at this point in the history
  • Loading branch information
kba committed Jun 7, 2020
1 parent fba15a6 commit 305b69a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tests/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,19 @@
import logging
import io
import collections
from unittest import TestCase as VanillaTestCase, skip, main
from unittest import TestCase as VanillaTestCase, skip, main as unittests_main
import pytest
from ocrd_utils import initLogging

from .assets import assets, copy_of_directory

def main(fn):
if fn:
sys.exit(pytest.main([fn]))
else:
unittests_main()


class TestCase(VanillaTestCase):

@classmethod
Expand Down

0 comments on commit 305b69a

Please sign in to comment.