Skip to content

Commit a6b967f

Browse files
author
Luiko Czub
committed
fix py37 DeprecationWarning *invalid escape sequence* in tests with regular expressions
1 parent bc0083b commit a6b967f

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

Diff for: CHANGES.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ test case attachments, which are stored since TL 1.9.19 with a reference to
88
the test case version instead the test case id .
99

1010
Parameter <version> is now mandatory for _uploadTestCaseAttachment_ and optional
11-
for _getTestCaseAttachments_.
11+
for _getTestCaseAttachments_.
1212

1313
implement other 1.9.20 (dev) changed api interfaces - #122
1414
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -24,9 +24,9 @@ API-XMLRPC - getTestCaseAttachments returns no attachment, uploaded with uploadT
2424

2525
- see TL Mantis Ticket 8658 <http://mantis.testlink.org/view.php?id=8658>`_
2626
- recommended to use the TL 1.9.20 development state with github commit
27-
6a4984164 or later (even for the TL upgrade or installation).
27+
6a4984164 or later (even for the TL upgrade or installation).
2828

29-
known TL 1.9.20 development state issues (github commit a1c7aca97):
29+
known TL 1.9.20 development state issue (github commit a1c7aca97):
3030
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3131
Calling getTestCasesForTestPlan() with the new optional argument <customfields> returns only internal db values.
3232
As alternative, loop over all returned test cases and call getTestCaseCustomFieldDesignValue().

Diff for: test/utest-offline/test_apiClients_whatArgs.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,21 @@ def test_whatArgs_noArgs(api_client):
3030

3131
def test_whatArgs_onlyOptionalArgs(api_client):
3232
response = api_client.whatArgs('getTestCaseKeywords')
33-
assert re.match('getTestCaseKeywords\(\[.*=<.*>\].*\).*',
33+
assert re.match(r'getTestCaseKeywords\(\[.*=<.*>\].*\).*',
3434
response)
3535

3636
def test_whatArgs_OptionalAndPositionalArgs(api_client):
3737
response = api_client.whatArgs('createBuild')
38-
assert re.match('createBuild\(<.*>.*\).*', response)
38+
assert re.match(r'createBuild\(<.*>.*\).*', response)
3939

4040
def test_whatArgs_MandatoryArgs(api_client):
4141
response = api_client.whatArgs('uploadExecutionAttachment')
42-
assert re.match('uploadExecutionAttachment\(<attachmentfile>, <.*>.*\).*',
42+
assert re.match(r'uploadExecutionAttachment\(<attachmentfile>, <.*>.*\).*',
4343
response)
4444

4545
def test_whatArgs_unknownMethods(api_client):
4646
response = api_client.whatArgs('apiUnknown')
47-
assert re.match("callServerWithPosArgs\('apiUnknown', \[apiArg=<apiArg>\]\)",
47+
assert re.match(r"callServerWithPosArgs\('apiUnknown', \[apiArg=<apiArg>\]\)",
4848
response)
4949

5050
test_data_apiCall_descriptions_equal_all = [

Diff for: test/utest-offline/testlinkapigeneric_offline_test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ def test_testLinkVersion_withTL199(self):
530530
def test_connectionInfo_beforeTL199(self):
531531
self.api.loadScenario(SCENARIO_TL198)
532532
response = self.api.connectionInfo()
533-
self.assertRegex(response, '\d*\.\d*\.\d*')
533+
self.assertRegex(response, r'\d*\.\d*\.\d*')
534534

535535
def test_getTestCaseCustomFieldDesignValue_notAssigned(self):
536536
self.api.loadScenario(SCENARIO_CUSTOM_FIELDS)

Diff for: test/utest-online/test_apiCall_equalPositionalArgs.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ def test_uploadAttachment_unknownID(api_client, attachmentFile):
254254
title='title 40000713', description='descr. 40000714')
255255

256256
def test_testLinkVersion(api_client):
257-
assert re.match('\d*\.\d*\.\d*', api_client.testLinkVersion() )
257+
assert re.match(r'\d*\.\d*\.\d*', api_client.testLinkVersion() )
258258

259259
def test_getUserByLogin_unknownKey(api_client):
260260
with pytest.raises(TLResponseError, match='10000.*User Login'):

0 commit comments

Comments
 (0)