Skip to content

Commit 6674afa

Browse files
committed
disable pyzmq zero-copy optimizations during session tests
1 parent aca5f70 commit 6674afa

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

jupyter_client/tests/test_session.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
import sys
99
import uuid
1010
from datetime import datetime
11+
try:
12+
from unittest import mock
13+
except ImportError:
14+
import mock
1115

1216
import pytest
1317

@@ -34,6 +38,14 @@ def setUp(self):
3438
self.session = ss.Session()
3539

3640

41+
@pytest.fixture
42+
def no_copy_threshold():
43+
"""Disable zero-copy optimizations in pyzmq >= 17"""
44+
with mock.patch.object(zmq, 'COPY_THRESHOLD', 1):
45+
yield
46+
47+
48+
@pytest.mark.usefixtures('no_copy_threshold')
3749
class TestSession(SessionTestCase):
3850

3951
def test_msg(self):

0 commit comments

Comments
 (0)