forked from supriya-project/supriya
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconftest.py
36 lines (27 loc) · 870 Bytes
/
conftest.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import pytest
import pytest_asyncio
import supriya
from supriya import scsynth
from supriya.realtime.servers import AsyncServer, Server
@pytest.fixture(autouse=True)
def add_libraries(doctest_namespace):
doctest_namespace["supriya"] = supriya
@pytest.fixture(autouse=True, scope="session")
def shutdown_scsynth():
scsynth.kill()
yield
scsynth.kill()
@pytest.fixture(autouse=True)
def shutdown_sync_servers(shutdown_scsynth):
for server in tuple(Server._servers):
server._shutdown()
yield
for server in tuple(Server._servers):
server._shutdown()
@pytest_asyncio.fixture(autouse=True)
async def shutdown_async_servers(shutdown_scsynth, event_loop):
for server in tuple(AsyncServer._servers):
await server._shutdown()
yield
for server in tuple(AsyncServer._servers):
await server._shutdown()