File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 2424from datetime import datetime , timedelta
2525import pytest
2626
27+ from requests .exceptions import ConnectionError
28+
2729import utilities as tutil
2830from sonar import issues , exceptions , logging
2931from sonar import utilities as util
@@ -254,10 +256,13 @@ def test_request_error() -> None:
254256 """test_request_error"""
255257 issues_d = issues .search_by_project (endpoint = tutil .TEST_SQ , project_key = tutil .PROJECT_1 )
256258 issue = list (issues_d .values ())[0 ]
259+ url = tutil .TEST_SQ .local_url
257260 tutil .TEST_SQ .local_url = "http://localhost:3337"
258- assert not issue .add_comment ("Won't work" )
259-
260- assert not issue .assign ("admin" )
261+ with pytest .raises (ConnectionError ):
262+ issue .add_comment ("Won't work" )
263+ with pytest .raises (ConnectionError ):
264+ issue .assign ("admin" )
265+ tutil .TEST_SQ .local_url = url
261266
262267
263268def test_transitions () -> None :
You can’t perform that action at this time.
0 commit comments