Skip to content

Commit

Permalink
Merge 2573ba7 into 2a4c7e6
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucretiel committed Jun 5, 2015
2 parents 2a4c7e6 + 2573ba7 commit 1c2d056
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions pytest_asyncio/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,7 @@ def event_loop(request):
event_loop = policy.new_event_loop()
policy.set_event_loop(event_loop)

def _close():
event_loop.close()

request.addfinalizer(_close)
request.addfinalizer(event_loop.close)
return event_loop


Expand All @@ -90,5 +87,4 @@ def unused_tcp_port():
"""Find an unused localhost TCP port from 1024-65535 and return it."""
with closing(socket.socket()) as sock:
sock.bind(('127.0.0.1', 0))
port = sock.getsockname()[1]
return port
return sock.getsockname()[1]

0 comments on commit 1c2d056

Please sign in to comment.