Skip to content

Commit

Permalink
Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
HardNorth committed Nov 29, 2024
1 parent 41d7843 commit b444b14
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tests/aio/test_aio_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ async def test_launch_url_get(aio_client, launch_mode: str, project_name: str, e
response.is_success = True
response.json.side_effect = lambda: {'mode': launch_mode, 'id': LAUNCH_ID}

async def get_call(*args, **kwargs):
async def get_call(*_, **__):
return response

(await aio_client.session()).get.side_effect = get_call
Expand Down Expand Up @@ -365,31 +365,31 @@ async def test_launch_uuid_print_default_print(mock_stdout):
assert 'ReportPortal Launch UUID: ' not in mock_stdout.getvalue()


def connection_error(*args, **kwargs):
def connection_error(*_, **__):
raise ServerConnectionError()


def json_error(*args, **kwargs):
def json_error(*_, **__):
raise JSONDecodeError('invalid Json', '502 Gateway Timeout', 0)


def response_error(*args, **kwargs):
def response_error(*_, **__):
result = mock.AsyncMock()
result.ok = False
result.json.side_effect = json_error
result.status_code = 502
return result


def invalid_response(*args, **kwargs):
def invalid_response(*_, **__):
result = mock.AsyncMock()
result.ok = True
result.json.side_effect = json_error
result.status_code = 200
return result


def request_error(*args, **kwargs):
def request_error(*_, **__):
raise ValueError()


Expand Down Expand Up @@ -417,7 +417,7 @@ async def test_connection_errors(aio_client, requests_method, client_method,
await getattr(aio_client, client_method)(*client_params)
except Exception as e:
# On this level we pass all errors through by design
assert type(e) == ServerConnectionError
assert type(e) is ServerConnectionError

getattr(await aio_client.session(), requests_method).side_effect = response_error
result = await getattr(aio_client, client_method)(*client_params)
Expand Down

0 comments on commit b444b14

Please sign in to comment.