mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-06-16 06:18:21 +00:00
reactor from fixture
This commit is contained in:
@ -117,7 +117,7 @@ def reactor():
|
|||||||
@pytest.fixture(scope='session')
|
@pytest.fixture(scope='session')
|
||||||
@log_call(action_type=u"integration:port_allocator", include_result=False)
|
@log_call(action_type=u"integration:port_allocator", include_result=False)
|
||||||
def port_allocator(reactor):
|
def port_allocator(reactor):
|
||||||
return create_port_allocator(start_port=45000)
|
return create_port_allocator(reactor, start_port=45000)
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope='session')
|
@pytest.fixture(scope='session')
|
||||||
|
@ -529,7 +529,7 @@ def create_grid(reactor, request, temp_dir, flog_gatherer, port_allocator):
|
|||||||
returnValue(grid)
|
returnValue(grid)
|
||||||
|
|
||||||
|
|
||||||
def create_port_allocator(start_port):
|
def create_port_allocator(reactor, start_port):
|
||||||
"""
|
"""
|
||||||
Returns a new port-allocator .. which is a zero-argument function
|
Returns a new port-allocator .. which is a zero-argument function
|
||||||
that returns Deferreds that fire with new, sequential ports
|
that returns Deferreds that fire with new, sequential ports
|
||||||
@ -546,11 +546,6 @@ def create_port_allocator(start_port):
|
|||||||
"""
|
"""
|
||||||
port = [start_port - 1]
|
port = [start_port - 1]
|
||||||
|
|
||||||
# import stays here to not interfere with reactor selection -- but
|
|
||||||
# maybe this function should be arranged to be called once from a
|
|
||||||
# fixture (with the reactor)?
|
|
||||||
from twisted.internet import reactor
|
|
||||||
|
|
||||||
class NothingProtocol(Protocol):
|
class NothingProtocol(Protocol):
|
||||||
"""
|
"""
|
||||||
I do nothing.
|
I do nothing.
|
||||||
|
Reference in New Issue
Block a user