Skip to content

Commit 02b159a

Browse files
Fix EJR error tests.
1 parent a52c1cc commit 02b159a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tests/test_jobregistry.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -1066,7 +1066,10 @@ def test_connection_error_logging(self, requests_mock, oidc_mock, ejr, caplog):
10661066
with pytest.raises(EjrApiError, match="Failed to do EJR API request"):
10671067
_ = ejr.get_job(job_id="job-123", user_id="john")
10681068

1069-
assert "Failed to do EJR API request `POST /jobs/search`: ConnectionError('Connection aborted')" in caplog.text
1069+
assert (
1070+
f"Failed to do EJR API request `POST {self.EJR_API_URL}/jobs/search`: ConnectionError('Connection aborted')"
1071+
in caplog.text
1072+
)
10701073

10711074
@pytest.mark.parametrize(
10721075
["tries", "failures", "success"],
@@ -1094,7 +1097,9 @@ def post_jobs_search(request, context):
10941097
result = ejr.list_user_jobs(user_id="john")
10951098
assert result == [DUMMY_PROCESS]
10961099
else:
1097-
with pytest.raises(EjrApiError, match="Failed to do EJR API request `POST /jobs/search`"):
1100+
with pytest.raises(
1101+
EjrApiError, match=f"Failed to do EJR API request `POST {self.EJR_API_URL}/jobs/search`"
1102+
):
10981103
_ = ejr.list_user_jobs(user_id="john")
10991104

11001105
assert sleep.call_count > 0

0 commit comments

Comments
 (0)