Skip to content

Commit ce2e0ee

Browse files
committed
tests/run-tests: Allow to skip tests using async/await keywords.
1 parent c6fd9ba commit ce2e0ee

3 files changed

Lines changed: 11 additions & 0 deletions

File tree

tests/feature_check/async_check.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# check if async/await keywords are supported
2+
async def foo():
3+
await 1

tests/feature_check/async_check.py.exp

Whitespace-only changes.

tests/run-tests

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ def run_tests(pyb, tests, args):
199199
skip_tests = set()
200200
skip_native = False
201201
skip_set_type = False
202+
skip_async = False
202203

203204
# Check if micropython.native is supported, and skip such tests if it's not
204205
native = run_micropython(pyb, args, 'feature_check/native_check.py')
@@ -210,6 +211,11 @@ def run_tests(pyb, tests, args):
210211
if native == b'CRASH':
211212
skip_set_type = True
212213

214+
# Check if async/await keywords are supported, and skip such tests if it's not
215+
native = run_micropython(pyb, args, 'feature_check/async_check.py')
216+
if native == b'CRASH':
217+
skip_async = True
218+
213219
# Check if emacs repl is supported, and skip such tests if it's not
214220
t = run_micropython(pyb, args, 'feature_check/repl_emacs_check.py')
215221
if not 'True' in str(t, 'ascii'):
@@ -314,11 +320,13 @@ def run_tests(pyb, tests, args):
314320
is_native = test_name.startswith("native_") or test_name.startswith("viper_")
315321
is_endian = test_name.endswith("_endian")
316322
is_set_type = test_name.startswith("set_") or test_name.startswith("frozenset")
323+
is_async = test_name.startswith("async_")
317324

318325
skip_it = test_file in skip_tests
319326
skip_it |= skip_native and is_native
320327
skip_it |= skip_endian and is_endian
321328
skip_it |= skip_set_type and is_set_type
329+
skip_it |= skip_async and is_async
322330

323331
if skip_it:
324332
print("skip ", test_file)

0 commit comments

Comments
 (0)