Fix pytests and enable parallel registry tests
This commit is contained in:
parent
135f4dae0c
commit
481cebe46b
7 changed files with 29 additions and 13 deletions
14
test/testutil.py
Normal file
14
test/testutil.py
Normal file
|
@ -0,0 +1,14 @@
|
|||
import socket
|
||||
|
||||
def get_open_port():
|
||||
""" Retrieves an open port on the system. """
|
||||
|
||||
# Bind a socket to a random port. We can then ask for the port number,
|
||||
# and return it.
|
||||
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
s.bind(("", 0))
|
||||
s.listen(1)
|
||||
port = s.getsockname()[1]
|
||||
s.close()
|
||||
|
||||
return port
|
Reference in a new issue