Skip to content

Commit 6dd2dfb

Browse files
committed
Ensure IPython's HistoryManager threads don't leak
1 parent 38b470a commit 6dd2dfb

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/conftest.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import zmq.asyncio
1212
from anyio import create_memory_object_stream, create_task_group
1313
from anyio.streams.memory import MemoryObjectReceiveStream, MemoryObjectSendStream
14+
from IPython.core.history import HistoryManager
1415
from jupyter_client.session import Session
1516

1617
from ipykernel.ipkernel import IPythonKernel
@@ -29,6 +30,10 @@
2930
tracemalloc = None
3031

3132

33+
# ensure we don't leak history managers
34+
HistoryManager._max_inst = 1
35+
36+
3237
@pytest.fixture()
3338
def anyio_backend():
3439
return "asyncio"

0 commit comments

Comments
 (0)