summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTapple <mfulmer@cisco.com>2023-02-21 11:29:22 -0500
committerTapple <mfulmer@cisco.com>2023-02-21 11:29:22 -0500
commitdce06b3ce546dfd5a090233ef0a639c3c5ce6fe6 (patch)
tree685458b5072aaafa0ddbe535b0d9044461a5f98a
parentf9ff4b99f622ae0afd38ad71a4368f2d2a2afa3f (diff)
downloadpexpect-dce06b3ce546dfd5a090233ef0a639c3c5ce6fe6.tar.gz
unit tests can now be imported on windows
-rwxr-xr-xtests/test_ctrl_chars.py5
-rw-r--r--tests/test_pxssh.py4
-rwxr-xr-xtests/test_run.py6
3 files changed, 10 insertions, 5 deletions
diff --git a/tests/test_ctrl_chars.py b/tests/test_ctrl_chars.py
index 0719fc7..11fb55c 100755
--- a/tests/test_ctrl_chars.py
+++ b/tests/test_ctrl_chars.py
@@ -26,8 +26,9 @@ from . import PexpectTestCase
import time
import sys
-from ptyprocess import ptyprocess
-ptyprocess._make_eof_intr()
+if sys.platform != 'win32':
+ from ptyprocess import ptyprocess
+ ptyprocess._make_eof_intr()
if sys.version_info[0] >= 3:
def byte(i):
diff --git a/tests/test_pxssh.py b/tests/test_pxssh.py
index c6ec4e2..ba700c8 100644
--- a/tests/test_pxssh.py
+++ b/tests/test_pxssh.py
@@ -1,10 +1,12 @@
#!/usr/bin/env python
+import sys
import os
import shutil
import tempfile
import unittest
-from pexpect import pxssh
+if sys.platform != 'win32':
+ from pexpect import pxssh
from .PexpectTestCase import PexpectTestCase
class SSHTestBase(PexpectTestCase):
diff --git a/tests/test_run.py b/tests/test_run.py
index baa6b49..15d0c40 100755
--- a/tests/test_run.py
+++ b/tests/test_run.py
@@ -52,7 +52,8 @@ def function_events_callback(values):
class RunFuncTestCase(PexpectTestCase.PexpectTestCase):
- runfunc = staticmethod(pexpect.run)
+ if sys.platform != 'win32':
+ runfunc = staticmethod(pexpect.run)
cr = b'\r'
empty = b''
prep_subprocess_out = staticmethod(lambda x: x)
@@ -160,7 +161,8 @@ class RunFuncTestCase(PexpectTestCase.PexpectTestCase):
class RunUnicodeFuncTestCase(RunFuncTestCase):
- runfunc = staticmethod(pexpect.runu)
+ if sys.platform != 'win32':
+ runfunc = staticmethod(pexpect.runu)
cr = b'\r'.decode('ascii')
empty = b''.decode('ascii')
prep_subprocess_out = staticmethod(lambda x: x.decode('utf-8', 'replace'))