MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / get_random_port

Function get_random_port

demo/imdb/disposableredis/__init__.py:9–15  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7import itertools
8
9def get_random_port():
10 sock = socket.socket()
11 sock.listen(0)
12 _, port = sock.getsockname()
13 sock.close()
14
15 return port
16
17
18class DisposableRedis(object):

Callers 1

__enter__Method · 0.70

Calls 1

closeMethod · 0.45

Tested by

no test coverage detected