Package: pexpect / 4.8.0-2

0003-tests-spawn-python3-not-python.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
From: Gordon Ball <gordon@chronitis.net>
Date: Mon, 4 Jan 2021 11:57:24 +0000
Subject: tests: spawn python3 not python

---
 tests/test_performance.py | 10 +++++-----
 tests/test_pxssh.py       |  2 +-
 tests/test_replwrap.py    |  4 ++--
 tests/test_run.py         |  4 ++--
 4 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/tests/test_performance.py b/tests/test_performance.py
index 63778af..e0c7df4 100755
--- a/tests/test_performance.py
+++ b/tests/test_performance.py
@@ -45,7 +45,7 @@ class PerformanceTestCase (PexpectTestCase.PexpectTestCase):
             return 'for n in range(1, %d+1): print(n)' % n
 
     def plain_range(self, n):
-        e = pexpect.spawn('python', timeout=100)
+        e = pexpect.spawn('python3', timeout=100)
         self.assertEqual(e.expect(b'>>>'), 0)
         e.sendline(self._iter_n(n))
         self.assertEqual(e.expect(br'\.{3}'), 0)
@@ -53,7 +53,7 @@ class PerformanceTestCase (PexpectTestCase.PexpectTestCase):
         self.assertEqual(e.expect([b'inquisition', '%d' % n]), 1)
 
     def window_range(self, n):
-        e = pexpect.spawn('python', timeout=100)
+        e = pexpect.spawn('python3', timeout=100)
         self.assertEqual(e.expect(b'>>>'), 0)
         e.sendline(self._iter_n(n))
         self.assertEqual(e.expect(r'\.{3}'), 0)
@@ -61,7 +61,7 @@ class PerformanceTestCase (PexpectTestCase.PexpectTestCase):
         self.assertEqual(e.expect([b'inquisition', '%d' % n], searchwindowsize=20), 1)
 
     def exact_range(self, n):
-        e = pexpect.spawn('python', timeout=100)
+        e = pexpect.spawn('python3', timeout=100)
         self.assertEqual(e.expect_exact([b'>>>']), 0)
         e.sendline(self._iter_n(n))
         self.assertEqual(e.expect_exact([b'...']), 0)
@@ -69,7 +69,7 @@ class PerformanceTestCase (PexpectTestCase.PexpectTestCase):
         self.assertEqual(e.expect_exact([b'inquisition', '%d' % n],timeout=520), 1)
 
     def ewin_range(self, n):
-        e = pexpect.spawn('python', timeout=100)
+        e = pexpect.spawn('python3', timeout=100)
         self.assertEqual(e.expect_exact([b'>>>']), 0)
         e.sendline(self._iter_n(n))
         self.assertEqual(e.expect_exact([b'...']), 0)
@@ -77,7 +77,7 @@ class PerformanceTestCase (PexpectTestCase.PexpectTestCase):
         self.assertEqual(e.expect_exact([b'inquisition', '%d' % n], searchwindowsize=20), 1)
 
     def faster_range(self, n):
-        e = pexpect.spawn('python', timeout=100)
+        e = pexpect.spawn('python3', timeout=100)
         self.assertEqual(e.expect(b'>>>'), 0)
         e.sendline(('list(range(1, %d+1))' % n).encode('ascii'))
         self.assertEqual(e.expect([b'inquisition', '%d' % n]), 1)
diff --git a/tests/test_pxssh.py b/tests/test_pxssh.py
index c6ec4e2..106b2b5 100644
--- a/tests/test_pxssh.py
+++ b/tests/test_pxssh.py
@@ -12,7 +12,7 @@ class SSHTestBase(PexpectTestCase):
         super(SSHTestBase, self).setUp()
         self.tempdir = tempfile.mkdtemp()
         self.orig_path = os.environ.get('PATH')
-        os.symlink(self.PYTHONBIN, os.path.join(self.tempdir, 'python'))
+        os.symlink(self.PYTHONBIN, os.path.join(self.tempdir, 'python3'))
         fakessh_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), 'fakessh'))
         os.environ['PATH'] = self.tempdir + os.pathsep + fakessh_dir + \
                     ((os.pathsep + self.orig_path) if self.orig_path else '')
diff --git a/tests/test_replwrap.py b/tests/test_replwrap.py
index 06ca07b..31898dd 100644
--- a/tests/test_replwrap.py
+++ b/tests/test_replwrap.py
@@ -97,7 +97,7 @@ class REPLWrapTestCase(unittest.TestCase):
         if platform.python_implementation() == 'PyPy':
             raise unittest.SkipTest(skip_pypy)
 
-        p = replwrap.python()
+        p = replwrap.python(command="python3")
         res = p.run_command('4+7')
         assert res.strip() == '11'
 
@@ -108,7 +108,7 @@ class REPLWrapTestCase(unittest.TestCase):
         if platform.python_implementation() == 'PyPy':
             raise unittest.SkipTest(skip_pypy)
 
-        child = pexpect.spawn('python', echo=False, timeout=5, encoding='utf-8')
+        child = pexpect.spawn('python3', echo=False, timeout=5, encoding='utf-8')
         # prompt_change=None should mean no prompt change
         py = replwrap.REPLWrapper(child, u">>> ", prompt_change=None,
                                   continuation_prompt=u"... ")
diff --git a/tests/test_run.py b/tests/test_run.py
index 401ddc6..443c979 100755
--- a/tests/test_run.py
+++ b/tests/test_run.py
@@ -69,8 +69,8 @@ class RunFuncTestCase(PexpectTestCase.PexpectTestCase):
         super(RunFuncTestCase, self).tearDown()
 
     def test_run_exit(self):
-        (data, exitstatus) = self.runfunc('python exit1.py', withexitstatus=1)
-        assert exitstatus == 1, "Exit status of 'python exit1.py' should be 1."
+        (data, exitstatus) = self.runfunc('python3 exit1.py', withexitstatus=1)
+        assert exitstatus == 1, "Exit status of 'python3 exit1.py' should be 1."
 
     def test_run(self):
         the_old_way = subprocess.Popen(