Skip to content

Commit ec0d617

Browse files
author
Bastien Abadie
committed
bot: Update pytest.raises syntax
1 parent 002db96 commit ec0d617

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

bot/tests/test_artifacts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def add_dir(files):
7272
'linux_xpcshell-7_code-coverage-grcov.zip'
7373
])
7474

75-
with pytest.raises(Exception, message='suite and chunk can\'t both have a value'):
75+
with pytest.raises(Exception, match='suite and chunk can\'t both have a value'):
7676
a.get(chunk='xpcshell-7', suite='mochitest')
7777

7878

bot/tests/test_grcov.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ def covdir_get(report, path):
1414

1515

1616
def test_report_invalid_output_format(grcov_artifact):
17-
with pytest.raises(AssertionError, message='Unsupported output format'):
17+
with pytest.raises(AssertionError, match='Unsupported output format'):
1818
grcov.report([grcov_artifact], out_format='UNSUPPORTED')
19-
with pytest.raises(AssertionError, message='Unsupported output format'):
19+
with pytest.raises(AssertionError, match='Unsupported output format'):
2020
grcov.report([grcov_artifact], out_format='coveralls')
2121

2222

bot/tests/test_taskcluster.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def test_get_task_failure(TASK_NOT_FOUND):
4545
err['code'] = 'RandomError'
4646
responses.add(responses.GET, 'https://index.taskcluster.net/v1/task/gecko.v2.mozilla-central.revision.b2a9a4bb5c94de179ae7a3f52fde58c0e2897498.firefox.linux64-ccov-debug', json=err, status=500) # noqa
4747

48-
with pytest.raises(taskcluster.TaskclusterException, message='Unknown TaskCluster index error.'):
48+
with pytest.raises(taskcluster.TaskclusterException, match='Unknown TaskCluster index error.'):
4949
taskcluster.get_task('mozilla-central', 'b2a9a4bb5c94de179ae7a3f52fde58c0e2897498', 'linux')
5050

5151

@@ -179,7 +179,7 @@ def test_get_platform():
179179
def test_download_artifact_forbidden(mocked_sleep, tmpdir):
180180
responses.add(responses.GET, 'https://queue.taskcluster.net/v1/task/FBdocjnAQOW_GJDOfmgjxw/artifacts/public/test_info/code-coverage-grcov.zip', body='xml error...', status=403) # noqa
181181

182-
with pytest.raises(requests.exceptions.HTTPError, message='403 Client Error: Forbidden for url: https://taskcluster-artifacts.net/FBdocjnAQOW_GJDOfmgjxw/0/public/test_info/code-coverage-grcov.zip'): # noqa
182+
with pytest.raises(requests.exceptions.HTTPError, match='403 Client Error: Forbidden for url: https://queue.taskcluster.net/v1/task/FBdocjnAQOW_GJDOfmgjxw/artifacts/public/test_info/code-coverage-grcov.zip'): # noqa
183183
taskcluster.download_artifact(
184184
os.path.join(tmpdir.strpath, 'windows_reftest-6_code-coverage-grcov.zip'),
185185
'FBdocjnAQOW_GJDOfmgjxw',
@@ -194,7 +194,7 @@ def test_download_artifact_forbidden(mocked_sleep, tmpdir):
194194
def test_download_artifact_badzip(mocked_sleep, tmpdir):
195195
responses.add(responses.GET, 'https://queue.taskcluster.net/v1/task/FBdocjnAQOW_GJDOfmgjxw/artifacts/public/test_info/code-coverage-grcov.zip', body='NOT A ZIP FILE', status=200, stream=True) # noqa
196196

197-
with pytest.raises(BadZipFile, message='File is not a zip file'):
197+
with pytest.raises(BadZipFile, match='File is not a zip file'):
198198
taskcluster.download_artifact(
199199
os.path.join(tmpdir.strpath, 'windows_reftest-6_code-coverage-grcov.zip'),
200200
'FBdocjnAQOW_GJDOfmgjxw',

0 commit comments

Comments
 (0)