summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Kluyver <takowl@gmail.com>2014-06-01 17:51:34 -0700
committerThomas Kluyver <takowl@gmail.com>2014-06-01 20:40:07 -0700
commit8d0e5684a479b93811f8433e672a041f4e0f25d2 (patch)
tree49da0c489ccf19295b47ec93c32d664f92dd678f
parent4be9a878b994b77d210840e72353f2c5c3e07536 (diff)
downloadpexpect-git-8d0e5684a479b93811f8433e672a041f4e0f25d2.tar.gz
Fix imports in tests for Python 3
Closes gh-59
-rwxr-xr-xtests/test_ansi.py2
-rwxr-xr-xtests/test_command_list_split.py3
-rwxr-xr-xtests/test_constructor.py2
-rwxr-xr-xtests/test_ctrl_chars.py2
-rwxr-xr-xtests/test_destructor.py2
-rwxr-xr-xtests/test_dotall.py2
-rwxr-xr-xtests/test_expect.py2
-rwxr-xr-xtests/test_filedescriptor.py2
-rwxr-xr-xtests/test_interact.py2
-rwxr-xr-xtests/test_isalive.py2
-rwxr-xr-xtests/test_log.py2
-rwxr-xr-xtests/test_misc.py2
-rwxr-xr-xtests/test_missing_command.py2
-rwxr-xr-xtests/test_performance.py2
-rw-r--r--tests/test_psh.py2
-rwxr-xr-xtests/test_run.py2
-rwxr-xr-xtests/test_run_out_of_pty.py2
-rwxr-xr-xtests/test_screen.py2
-rwxr-xr-xtests/test_timeout_pattern.py2
-rw-r--r--tests/test_unicode.py2
-rwxr-xr-xtests/test_winsize.py2
21 files changed, 22 insertions, 21 deletions
diff --git a/tests/test_ansi.py b/tests/test_ansi.py
index 546c0f4..502c4b3 100755
--- a/tests/test_ansi.py
+++ b/tests/test_ansi.py
@@ -20,7 +20,7 @@ PEXPECT LICENSE
'''
from pexpect import ANSI
import unittest
-import PexpectTestCase
+from . import PexpectTestCase
write_target = 'I\'ve got a ferret sticking up my nose. \n' +\
'(He\'s got a ferret sticking up his nose.) \n' +\
diff --git a/tests/test_command_list_split.py b/tests/test_command_list_split.py
index 2213b45..370f46e 100755
--- a/tests/test_command_list_split.py
+++ b/tests/test_command_list_split.py
@@ -20,7 +20,8 @@ PEXPECT LICENSE
'''
import pexpect
import unittest
-import PexpectTestCase
+from . import PexpectTestCase
+
class SplitCommandLineTestCase(PexpectTestCase.PexpectTestCase):
def testSplitSizes(self):
assert len(pexpect.split_command_line(r'')) == 0
diff --git a/tests/test_constructor.py b/tests/test_constructor.py
index 9611274..60525a0 100755
--- a/tests/test_constructor.py
+++ b/tests/test_constructor.py
@@ -20,7 +20,7 @@ PEXPECT LICENSE
'''
import pexpect
import unittest
-import PexpectTestCase
+from . import PexpectTestCase
class TestCaseConstructor(PexpectTestCase.PexpectTestCase):
def test_constructor (self):
diff --git a/tests/test_ctrl_chars.py b/tests/test_ctrl_chars.py
index 336337c..7b87840 100755
--- a/tests/test_ctrl_chars.py
+++ b/tests/test_ctrl_chars.py
@@ -22,7 +22,7 @@ from __future__ import print_function
import pexpect
import unittest
-import PexpectTestCase
+from . import PexpectTestCase
import time
import sys
diff --git a/tests/test_destructor.py b/tests/test_destructor.py
index 5b6087d..d27b6f6 100755
--- a/tests/test_destructor.py
+++ b/tests/test_destructor.py
@@ -20,7 +20,7 @@ PEXPECT LICENSE
'''
import pexpect
import unittest
-import PexpectTestCase
+from . import PexpectTestCase
import gc
import platform
import time
diff --git a/tests/test_dotall.py b/tests/test_dotall.py
index 7f574b3..68aef3f 100755
--- a/tests/test_dotall.py
+++ b/tests/test_dotall.py
@@ -21,7 +21,7 @@ PEXPECT LICENSE
import pexpect
import unittest
import re
-import PexpectTestCase
+from . import PexpectTestCase
testdata = 'BEGIN\nHello world\nEND'
class TestCaseDotall(PexpectTestCase.PexpectTestCase):
diff --git a/tests/test_expect.py b/tests/test_expect.py
index 6c4fa10..feff123 100755
--- a/tests/test_expect.py
+++ b/tests/test_expect.py
@@ -23,7 +23,7 @@ import pexpect
import unittest
import subprocess
import time
-import PexpectTestCase
+from . import PexpectTestCase
import signal
# Many of these test cases blindly assume that sequential directory
diff --git a/tests/test_filedescriptor.py b/tests/test_filedescriptor.py
index 5ae90c7..ac391b5 100755
--- a/tests/test_filedescriptor.py
+++ b/tests/test_filedescriptor.py
@@ -21,7 +21,7 @@ PEXPECT LICENSE
import pexpect
from pexpect import fdpexpect
import unittest
-import PexpectTestCase
+from . import PexpectTestCase
import os
class ExpectTestCase(PexpectTestCase.PexpectTestCase):
diff --git a/tests/test_interact.py b/tests/test_interact.py
index d3416dd..0c17580 100755
--- a/tests/test_interact.py
+++ b/tests/test_interact.py
@@ -24,7 +24,7 @@ from __future__ import unicode_literals
import pexpect
import unittest
-import PexpectTestCase
+from . import PexpectTestCase
class InteractTestCase (PexpectTestCase.PexpectTestCase):
diff --git a/tests/test_isalive.py b/tests/test_isalive.py
index d725631..cbb474d 100755
--- a/tests/test_isalive.py
+++ b/tests/test_isalive.py
@@ -23,7 +23,7 @@ import unittest
import signal
import sys
import time
-import PexpectTestCase
+from . import PexpectTestCase
class IsAliveTestCase(PexpectTestCase.PexpectTestCase):
diff --git a/tests/test_log.py b/tests/test_log.py
index d0d148a..4ad2256 100755
--- a/tests/test_log.py
+++ b/tests/test_log.py
@@ -22,7 +22,7 @@ import pexpect
import unittest
import os
import tempfile
-import PexpectTestCase
+from . import PexpectTestCase
# the program cat(1) may display ^D\x08\x08 when \x04 (EOF, Ctrl-D) is sent
_CAT_EOF = b'^D\x08\x08'
diff --git a/tests/test_misc.py b/tests/test_misc.py
index 3a9e12a..7569070 100755
--- a/tests/test_misc.py
+++ b/tests/test_misc.py
@@ -20,7 +20,7 @@ PEXPECT LICENSE
'''
import pexpect
import unittest
-import PexpectTestCase
+from . import PexpectTestCase
import os
import sys
import tempfile
diff --git a/tests/test_missing_command.py b/tests/test_missing_command.py
index fea9218..92e4733 100755
--- a/tests/test_missing_command.py
+++ b/tests/test_missing_command.py
@@ -20,7 +20,7 @@ PEXPECT LICENSE
'''
import pexpect
import unittest
-import PexpectTestCase
+from . import PexpectTestCase
class MissingCommandTestCase (PexpectTestCase.PexpectTestCase):
def testMissingCommand(self):
diff --git a/tests/test_performance.py b/tests/test_performance.py
index 9754e56..597c6f9 100755
--- a/tests/test_performance.py
+++ b/tests/test_performance.py
@@ -22,7 +22,7 @@ from __future__ import print_function
import unittest, time, sys
import pexpect
-import PexpectTestCase
+from . import PexpectTestCase
# This isn't exactly a unit test, but it fits in nicely with the rest of the tests.
diff --git a/tests/test_psh.py b/tests/test_psh.py
index 2e7ad3e..b765c7e 100644
--- a/tests/test_psh.py
+++ b/tests/test_psh.py
@@ -2,7 +2,7 @@
import unittest
from pexpect import pxssh, psh
-from test_pxssh import SSHTestBase
+from .test_pxssh import SSHTestBase
class PshTestBase(SSHTestBase):
def test_psh(self):
diff --git a/tests/test_run.py b/tests/test_run.py
index 6346ced..814b70a 100755
--- a/tests/test_run.py
+++ b/tests/test_run.py
@@ -23,7 +23,7 @@ import pexpect
import unittest
import subprocess
import sys
-import PexpectTestCase
+from . import PexpectTestCase
# TODO Many of these test cases blindly assume that sequential
# TODO listing of the /bin directory will yield the same results.
diff --git a/tests/test_run_out_of_pty.py b/tests/test_run_out_of_pty.py
index ac986fa..3090147 100755
--- a/tests/test_run_out_of_pty.py
+++ b/tests/test_run_out_of_pty.py
@@ -20,7 +20,7 @@ PEXPECT LICENSE
'''
import pexpect
import unittest
-import PexpectTestCase
+from . import PexpectTestCase
class ExpectTestCase(PexpectTestCase.PexpectTestCase):
# This takes too long to run and isn't all that interesting of a test.
diff --git a/tests/test_screen.py b/tests/test_screen.py
index 5e2685b..3f0736b 100755
--- a/tests/test_screen.py
+++ b/tests/test_screen.py
@@ -21,7 +21,7 @@ PEXPECT LICENSE
from pexpect import screen
import unittest
-import PexpectTestCase
+from . import PexpectTestCase
fill1_target='XXXXXXXXXX\n' + \
'XOOOOOOOOX\n' + \
diff --git a/tests/test_timeout_pattern.py b/tests/test_timeout_pattern.py
index c0a9b97..5f610ef 100755
--- a/tests/test_timeout_pattern.py
+++ b/tests/test_timeout_pattern.py
@@ -21,7 +21,7 @@ PEXPECT LICENSE
from __future__ import with_statement # bring 'with' stmt to py25
import pexpect
import unittest
-import PexpectTestCase
+from . import PexpectTestCase
import sys
class Exp_TimeoutTestCase(PexpectTestCase.PexpectTestCase):
diff --git a/tests/test_unicode.py b/tests/test_unicode.py
index a6de35b..38e758d 100644
--- a/tests/test_unicode.py
+++ b/tests/test_unicode.py
@@ -6,7 +6,7 @@ import tempfile
import pexpect
import unittest
-import PexpectTestCase
+from . import PexpectTestCase
# the program cat(1) may display ^D\x08\x08 when \x04 (EOF, Ctrl-D) is sent
_CAT_EOF = '^D\x08\x08'
diff --git a/tests/test_winsize.py b/tests/test_winsize.py
index f029ad3..75f8c0e 100755
--- a/tests/test_winsize.py
+++ b/tests/test_winsize.py
@@ -20,7 +20,7 @@ PEXPECT LICENSE
'''
import pexpect
import unittest
-import PexpectTestCase
+from . import PexpectTestCase
import time
class TestCaseWinsize(PexpectTestCase.PexpectTestCase):