Experiment: Wrap all capnp code in a context-manager to avoid segfaults (#317)
* Experiment: Wrap all capnp code in a context-manager * Fix segfault in on_disconnect
This commit is contained in:
committed by
GitHub
parent
d48ffea939
commit
e13a0c9254
@@ -2,6 +2,7 @@ import gc
|
||||
import os
|
||||
import socket
|
||||
import sys # add examples dir to sys.path
|
||||
import pytest
|
||||
|
||||
import capnp
|
||||
|
||||
@@ -12,6 +13,12 @@ import async_calculator_client # noqa: E402
|
||||
import async_calculator_server # noqa: E402
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
async def kj_loop():
|
||||
async with capnp.kj_loop():
|
||||
yield
|
||||
|
||||
|
||||
async def test_calculator():
|
||||
read, write = socket.socketpair()
|
||||
read = await capnp.AsyncIoStream.create_connection(sock=read)
|
||||
|
||||
Reference in New Issue
Block a user