Skip to content

Commit e3ad3e1

Browse files
committed
Limit IPython HistoryManager instance number to 1
1 parent 1b1a0a1 commit e3ad3e1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/conftest.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import logging
2+
import os
23
import warnings
34
from math import inf
45
from threading import Event
@@ -10,12 +11,17 @@
1011
import zmq_anyio
1112
from anyio import create_memory_object_stream, create_task_group, sleep
1213
from anyio.streams.memory import MemoryObjectReceiveStream, MemoryObjectSendStream
14+
from IPython.core.history import HistoryManager
1315
from jupyter_client.session import Session
1416

1517
from ipykernel.ipkernel import IPythonKernel
1618
from ipykernel.kernelbase import Kernel
1719
from ipykernel.zmqshell import ZMQInteractiveShell
1820

21+
# ensure we don't leak History managers
22+
if os.name != "nt":
23+
HistoryManager._max_inst = 1
24+
1925
try:
2026
import resource
2127
except ImportError:

0 commit comments

Comments
 (0)