mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-18 12:28:09 +00:00
Merge pull request #319 from ph4r05/tests_async
tests: support async test cases added
This commit is contained in:
commit
aab3a5eed6
@ -1,4 +1,5 @@
|
||||
from trezor.utils import ensure
|
||||
from utest import assert_async
|
||||
|
||||
|
||||
class SkipTest(Exception):
|
||||
@ -178,11 +179,15 @@ def run_class(c, test_result):
|
||||
print('class', c.__qualname__)
|
||||
for name in dir(o):
|
||||
if name.startswith("test"):
|
||||
is_async = name.startswith("test_async")
|
||||
print(' ', name, end=' ...')
|
||||
m = getattr(o, name)
|
||||
try:
|
||||
set_up()
|
||||
test_result.testsRun += 1
|
||||
if is_async:
|
||||
assert_async(m(), [(None, StopIteration()), ])
|
||||
else:
|
||||
m()
|
||||
tear_down()
|
||||
print(" ok")
|
||||
|
Loading…
Reference in New Issue
Block a user