Skip to content

Commit 0994627

Browse files
harkamaljotgcf-owl-bot[bot]chalmerlowe
authored
tests: enable reuse of socket (#399)
Currently OAuthlib has some tests that uses a port to start a local server. Port cleanup takes a long time as a result we start seeing socket in use error. So passing socket re-use flag, so that we can reuse the sockets. --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Chalmer Lowe <chalmerlowe@google.com>
1 parent 84599aa commit 0994627

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

packages/google-auth-oauthlib/tests/unit/test_flow.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ def port(self):
269269
@pytest.fixture
270270
def socket(self, port):
271271
s = socket.socket()
272+
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) # Enable SO_REUSEADDR
272273
s.bind(("localhost", port))
273274
yield s
274275
s.close()

0 commit comments

Comments
 (0)