Skip to content

Commit 90594e9

Browse files
committed
windows compat
- try to ensure ipython_dir is cleaned up last - use CTRL_C_EVENT for Windows (can't use SIGINT)
1 parent 567a422 commit 90594e9

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

ipyparallel/tests/conftest.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,17 @@ def pytest_collection_modifyitems(items):
4747

4848

4949
@pytest.fixture(scope="session")
50-
def cluster(request):
50+
def cluster(request, ipython_dir):
5151
"""Setup IPython parallel cluster"""
5252
setup()
53-
request.addfinalizer(teardown)
53+
try:
54+
yield
55+
finally:
56+
teardown()
5457

5558

5659
@pytest.fixture(scope='session')
57-
def ipython():
60+
def ipython(ipython_dir):
5861
config = default_config()
5962
config.TerminalInteractiveShell.simple_prompt = True
6063
shell = TerminalInteractiveShell.instance(config=config)
@@ -81,7 +84,7 @@ def Context():
8184

8285

8386
@pytest.fixture
84-
def Cluster(request, io_loop):
87+
def Cluster(request, ipython_dir, io_loop):
8588
"""Fixture for instantiating Clusters"""
8689

8790
def ClusterConstructor(**kwargs):

ipyparallel/tests/test_client.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,12 @@ def test_wait_for_engines(self):
661661

662662
def test_signal_engines(self):
663663
view = self.client[:]
664-
for sig in (signal.SIGINT, 'SIGINT'):
664+
if sys.platform.startswith("win"):
665+
signame = 'CTRL_C_EVENT'
666+
else:
667+
signame = 'SIGINT'
668+
signum = getattr(signal, signame)
669+
for sig in (signum, signame):
665670
ar = view.apply_async(time.sleep, 10)
666671
# FIXME: use status:busy to wait for tasks to start
667672
time.sleep(1)

0 commit comments

Comments
 (0)