Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Pass port range from get_user_credentials to find_open_port #212

Merged
merged 4 commits into from
Aug 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion google_auth_oauthlib/interactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def get_user_credentials(
client_config, scopes=scopes
)

port = find_open_port()
port = find_open_port(start=minimum_port, stop=maximum_port)
if not port:
raise ConnectionError("Could not find open port.")

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_interactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def test_get_user_credentials_raises_connectionerror(monkeypatch):
from google_auth_oauthlib import flow
from google_auth_oauthlib import interactive as module_under_test

def mock_find_open_port():
def mock_find_open_port(start=8080, stop=None):
return None

monkeypatch.setattr(module_under_test, "find_open_port", mock_find_open_port)
Expand Down