Skip to content

Commit

Permalink
test: fix invalid escape sequence
Browse files Browse the repository at this point in the history
Running the tests leads to

test/test_litmus.py:110
test/test_litmus.py:110: DeprecationWarning: invalid escape sequence '\d'
    if len(re.findall('^ *\d+\.', line)):

'\d' can appear in a regular expression but is invalid in a Unicode
string.

Convert the Unicode string to a regular expression.

Signed-off-by: Heinrich Schuchardt <[email protected]>
  • Loading branch information
xypron authored and andrewleech committed Jul 6, 2023
1 parent a0b251c commit 517b398
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/test_litmus.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def test_run_litmus(self):
for line in lines:
line = line.split('\r')[-1]
result.append(line)
if len(re.findall('^ *\d+\.', line)):
if len(re.findall(r'^ *\d+\.', line)):
assert line.endswith('pass'), line

finally:
Expand Down Expand Up @@ -107,7 +107,7 @@ def test_run_litmus_noauth(self):
for line in lines:
line = line.split('\r')[-1]
result.append(line)
if len(re.findall('^ *\d+\.', line)):
if len(re.findall(r'^ *\d+\.', line)):
assert line.endswith('pass'), line

finally:
Expand Down

0 comments on commit 517b398

Please sign in to comment.