Skip to content

Commit

Permalink
Ignore coverage reports on unreachable code
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgolec committed Jun 12, 2024
1 parent db545f0 commit 550acf1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion schwab/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ async def oauth_client_update_token(t, *args, **kwargs):
token_metadata=metadata_manager, enforce_enums=enforce_enums)


# This runs in a separate process and is invisible to coverage
# pragma: no cover
def __run_client_from_login_flow_server(q, callback_port, callback_path):
'''Helper server for intercepting redirects to the callback URL. See
client_from_login_flow for details.'''
Expand Down Expand Up @@ -222,8 +224,10 @@ def client_from_login_flow(api_key, app_secret, callback_url, token_path,
# Attempt to send a request to the server
try:
resp = requests.get(
'https://127.0.0.1:{}//schwab-py-internal/status'.format(
'https://127.0.0.1:{}/schwab-py-internal/status'.format(
callback_port))

# pragma: no cover
break

Check warning on line 231 in schwab/auth.py

View check run for this annotation

Codecov / codecov/patch

schwab/auth.py#L231

Added line #L231 was not covered by tests
except requests.exceptions.ConnectionError as e:
# Treat refusal to connect due to a self-signed certificate as a
Expand Down

0 comments on commit 550acf1

Please sign in to comment.