From 07eb34c8e2153d64153a2c1075b040ad7db5edc3 Mon Sep 17 00:00:00 2001 From: Benedek Racz Date: Fri, 22 Nov 2019 09:23:02 +0100 Subject: [PATCH] [FIX][TST] descructor test python executable --- tests/test_destructor.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/test_destructor.py b/tests/test_destructor.py index 29720c9..6c62c08 100644 --- a/tests/test_destructor.py +++ b/tests/test_destructor.py @@ -32,10 +32,10 @@ class TestCaseDestructor(PexpectTestCase.PexpectTestCase): return 'SKIP' gc.collect() time.sleep(2) - p1 = wexpect.spawn('%s hello_world.py' % self.PYTHONBIN) - p2 = wexpect.spawn('%s hello_world.py' % self.PYTHONBIN) - p3 = wexpect.spawn('%s hello_world.py' % self.PYTHONBIN) - p4 = wexpect.spawn('%s hello_world.py' % self.PYTHONBIN) + p1 = wexpect.spawn('"%s" hello_world.py' % self.PYTHONBIN) + p2 = wexpect.spawn('"%s" hello_world.py' % self.PYTHONBIN) + p3 = wexpect.spawn('"%s" hello_world.py' % self.PYTHONBIN) + p4 = wexpect.spawn('"%s" hello_world.py' % self.PYTHONBIN) fd_t1 = (p1.child_fd,p2.child_fd,p3.child_fd,p4.child_fd) p1.expect(wexpect.EOF) p2.expect(wexpect.EOF) @@ -52,10 +52,10 @@ class TestCaseDestructor(PexpectTestCase.PexpectTestCase): gc.collect() time.sleep(2) # Some platforms are slow at gc... Solaris! - p1 = wexpect.spawn('%s hello_world.py' % self.PYTHONBIN) - p2 = wexpect.spawn('%s hello_world.py' % self.PYTHONBIN) - p3 = wexpect.spawn('%s hello_world.py' % self.PYTHONBIN) - p4 = wexpect.spawn('%s hello_world.py' % self.PYTHONBIN) + p1 = wexpect.spawn('"%s" hello_world.py' % self.PYTHONBIN) + p2 = wexpect.spawn('"%s" hello_world.py' % self.PYTHONBIN) + p3 = wexpect.spawn('"%s" hello_world.py' % self.PYTHONBIN) + p4 = wexpect.spawn('"%s" hello_world.py' % self.PYTHONBIN) fd_t2 = (p1.child_fd,p2.child_fd,p3.child_fd,p4.child_fd) p1.kill(9) p2.kill(9) @@ -68,10 +68,10 @@ class TestCaseDestructor(PexpectTestCase.PexpectTestCase): gc.collect() time.sleep(2) - p1 = wexpect.spawn('%s hello_world.py' % self.PYTHONBIN) - p2 = wexpect.spawn('%s hello_world.py' % self.PYTHONBIN) - p3 = wexpect.spawn('%s hello_world.py' % self.PYTHONBIN) - p4 = wexpect.spawn('%s hello_world.py' % self.PYTHONBIN) + p1 = wexpect.spawn('"%s" hello_world.py' % self.PYTHONBIN) + p2 = wexpect.spawn('"%s" hello_world.py' % self.PYTHONBIN) + p3 = wexpect.spawn('"%s" hello_world.py' % self.PYTHONBIN) + p4 = wexpect.spawn('"%s" hello_world.py' % self.PYTHONBIN) fd_t3 = (p1.child_fd,p2.child_fd,p3.child_fd,p4.child_fd) assert (fd_t1 == fd_t2 == fd_t3), "pty file descriptors not properly garbage collected (fd_t1,fd_t2,fd_t3)=(%s,%s,%s)" % (str(fd_t1),str(fd_t2),str(fd_t3))