Skip to content

Commit 479330a

Browse files
authored
fix: Pass port range from get_user_credentials to find_open_port (#212)
* Port range now passed in
1 parent b081043 commit 479330a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

google_auth_oauthlib/interactive.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ def get_user_credentials(
166166
client_config, scopes=scopes
167167
)
168168

169-
port = find_open_port()
169+
port = find_open_port(start=minimum_port, stop=maximum_port)
170170
if not port:
171171
raise ConnectionError("Could not find open port.")
172172

tests/unit/test_interactive.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def test_get_user_credentials_raises_connectionerror(monkeypatch):
8080
from google_auth_oauthlib import flow
8181
from google_auth_oauthlib import interactive as module_under_test
8282

83-
def mock_find_open_port():
83+
def mock_find_open_port(start=8080, stop=None):
8484
return None
8585

8686
monkeypatch.setattr(module_under_test, "find_open_port", mock_find_open_port)

0 commit comments

Comments
 (0)