diff --git a/tests/extmod/re_finditer.py b/tests/extmod/re_finditer.py index 6043a37e3f..4794ea61a0 100644 --- a/tests/extmod/re_finditer.py +++ b/tests/extmod/re_finditer.py @@ -5,21 +5,21 @@ except ImportError: print("SKIP") raise SystemExit -ms = re.finditer(r'f[a-z]*', 'which foot or hand fell fastest') +ms = re.finditer(r"f[a-z]*", "which foot or hand fell fastest") print(list(x.group(0) for x in ms)) -p = re.compile(r'f[a-z]*') -ms = p.finditer('which foot or hand fell fastest') +p = re.compile(r"f[a-z]*") +ms = p.finditer("which foot or hand fell fastest") print(list(x.group(0) for x in ms)) -ms = p.finditer('which foot or hand fell fastest', 10) +ms = p.finditer("which foot or hand fell fastest", 10) print(list(x.group(0) for x in ms)) -ms = p.finditer('which foot or hand fell fastest', 10, 21) +ms = p.finditer("which foot or hand fell fastest", 10, 21) print(list(x.group(0) for x in ms)) -ms = re.finditer(r'\s+', 'which foot or hand fell fastest') +ms = re.finditer(r"\s+", "which foot or hand fell fastest") print(list(x.group(0) for x in ms)) -ms = re.finditer(r'zz', 'which foot or hand fell fastest') +ms = re.finditer(r"zz", "which foot or hand fell fastest") print(list(x.group(0) for x in ms)) diff --git a/tests/extmod/re_start_end_pos.py b/tests/extmod/re_start_end_pos.py index f8405b7852..5330d1b54e 100644 --- a/tests/extmod/re_start_end_pos.py +++ b/tests/extmod/re_start_end_pos.py @@ -18,6 +18,7 @@ def print_groups(match): except IndexError: pass + p = re.compile(r"o") m = p.match("dog") print_groups(m) @@ -45,15 +46,14 @@ m = p.match("dog", 1, 1) print_groups(m) # Search also works -print('--search') +print("--search") p = re.compile(r"o") -m = p.search('dog') +m = p.search("dog") print_groups(m) -m = p.search('dog', 1) +m = p.search("dog", 1) print_groups(m) -m = p.search('dog', 2) +m = p.search("dog", 2) print_groups(m) -