mirror of
https://github.com/GNS3/gns3-server
synced 2024-12-23 23:38:21 +00:00
Do not try to use ProactorEventLoop() on non Windows platforms.
This commit is contained in:
parent
8976384a56
commit
09e9382df1
@ -22,15 +22,16 @@ from .handlers.api.base import Query
|
||||
sys._called_from_test = True
|
||||
sys.original_platform = sys.platform
|
||||
|
||||
@pytest.mark.skipif(not sys.platform.startswith("win"), reason="asyncio.ProactorEventLoop() is Only supported on Windows")
|
||||
@pytest.yield_fixture(scope="session")
|
||||
def loop(request):
|
||||
"""Return an event loop and destroy it at the end of test"""
|
||||
|
||||
loop = asyncio.ProactorEventLoop()
|
||||
asyncio.set_event_loop(loop) # Replace main loop to avoid conflict between tests
|
||||
yield loop
|
||||
asyncio.set_event_loop(None)
|
||||
if sys.platform.startswith("win"):
|
||||
@pytest.yield_fixture(scope="session")
|
||||
def loop(request):
|
||||
"""Return an event loop and destroy it at the end of test"""
|
||||
|
||||
loop = asyncio.ProactorEventLoop()
|
||||
asyncio.set_event_loop(loop) # Replace main loop to avoid conflict between tests
|
||||
yield loop
|
||||
asyncio.set_event_loop(None)
|
||||
|
||||
|
||||
@pytest.fixture(scope='function')
|
||||
|
Loading…
Reference in New Issue
Block a user