Skip to content

Commit 11a29d2

Browse files
committed
use wexpect instead of pexpect on Windows
1 parent 913e8a6 commit 11a29d2

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

adaptive/tests/test_runner.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import asyncio
2+
import os
23
import sys
34
import time
45

@@ -72,9 +73,13 @@ async def f(x):
7273
@pytest.fixture(scope="session")
7374
def ipyparallel_executor():
7475
from ipyparallel import Client
75-
import pexpect
7676

77-
child = pexpect.spawn("ipcluster start -n 1")
77+
if os.name == "nt":
78+
import wexpect as expect
79+
else:
80+
import pexpect as expect
81+
82+
child = expect.spawn("ipcluster start -n 1")
7883
child.expect("Engines appear to have started successfully", timeout=35)
7984
yield Client()
8085
if not child.terminate(force=True):

setup.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env python3
22

3+
import os
34
import sys
45

56
from setuptools import find_packages, setup
@@ -48,10 +49,14 @@ def get_version_and_cmdclass(package_name):
4849
"pytest-timeout",
4950
"pre_commit",
5051
],
51-
"other": ["pexpect", "ipyparallel", "distributed", "scikit-optimize"],
52+
"other": [
53+
"ipyparallel",
54+
"distributed",
55+
"scikit-optimize",
56+
"wexpect" if os.name == "nt" else "pexpect",
57+
],
5258
}
5359

54-
5560
setup(
5661
name="adaptive",
5762
description="Parallel active learning of mathematical functions",

0 commit comments

Comments
 (0)