Skip to content

Commit ecb77e4

Browse files
committed
tests: Add feature check for slice and skip corresponding tests.
1 parent 9162a87 commit ecb77e4

3 files changed

Lines changed: 13 additions & 0 deletions

File tree

tests/feature_check/slice.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
try:
2+
slice
3+
print("slice")
4+
except NameError:
5+
print("no")

tests/feature_check/slice.py.exp

Whitespace-only changes.

tests/run-tests

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ def run_tests(pyb, tests, args, base_path="."):
223223
skip_int_big = False
224224
skip_bytearray = False
225225
skip_set_type = False
226+
skip_slice = False
226227
skip_async = False
227228
skip_const = False
228229
skip_revops = False
@@ -255,6 +256,11 @@ def run_tests(pyb, tests, args, base_path="."):
255256
if output == b'CRASH':
256257
skip_set_type = True
257258

259+
# Check if slice is supported, and skip such tests if it's not
260+
output = run_feature_check(pyb, args, base_path, 'slice.py')
261+
if output != b'slice\n':
262+
skip_slice = True
263+
258264
# Check if async/await keywords are supported, and skip such tests if it's not
259265
output = run_feature_check(pyb, args, base_path, 'async_check.py')
260266
if output == b'CRASH':
@@ -405,6 +411,7 @@ def run_tests(pyb, tests, args, base_path="."):
405411
is_int_big = test_name.startswith("int_big") or test_name.endswith("_intbig")
406412
is_bytearray = test_name.startswith("bytearray") or test_name.endswith("_bytearray")
407413
is_set_type = test_name.startswith("set_") or test_name.startswith("frozenset")
414+
is_slice = test_name.find("slice") != -1
408415
is_async = test_name.startswith("async_")
409416
is_const = test_name.startswith("const")
410417

@@ -414,6 +421,7 @@ def run_tests(pyb, tests, args, base_path="."):
414421
skip_it |= skip_int_big and is_int_big
415422
skip_it |= skip_bytearray and is_bytearray
416423
skip_it |= skip_set_type and is_set_type
424+
skip_it |= skip_slice and is_slice
417425
skip_it |= skip_async and is_async
418426
skip_it |= skip_const and is_const
419427
skip_it |= skip_revops and test_name.startswith("class_reverse_op")

0 commit comments

Comments
 (0)