Skip to content

Commit d11cb5e

Browse files
author
Gavin Bisesi
committed
Fix pytest-dev#44 - don't try to bind a random port.
This hangs indefinitely on macOS for an unknown reason
1 parent c19dc69 commit d11cb5e

File tree

1 file changed

+1
-3
lines changed
  • pytest-server-fixtures/pytest_server_fixtures

1 file changed

+1
-3
lines changed

pytest-server-fixtures/pytest_server_fixtures/base.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ def get_ephemeral_host():
3636
while True:
3737
try:
3838
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
39-
host = '127.{}.{}.{}'.format(random.randrange(1, 255),
40-
random.randrange(1, 255),
41-
random.randrange(2, 255),)
39+
host = '127.0.0.1'
4240
s.bind((host, 5000))
4341
s.listen(0)
4442
_SESSION_HOST = (host, s)

0 commit comments

Comments
 (0)