mirror of
https://github.com/clearml/wexpect-venv
synced 2025-02-07 13:30:56 +00:00
[FIX][TST] descructor test python executable
This commit is contained in:
parent
73fa299475
commit
07eb34c8e2
@ -32,10 +32,10 @@ class TestCaseDestructor(PexpectTestCase.PexpectTestCase):
|
|||||||
return 'SKIP'
|
return 'SKIP'
|
||||||
gc.collect()
|
gc.collect()
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
p1 = 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)
|
p2 = wexpect.spawn('"%s" hello_world.py' % self.PYTHONBIN)
|
||||||
p3 = 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)
|
p4 = wexpect.spawn('"%s" hello_world.py' % self.PYTHONBIN)
|
||||||
fd_t1 = (p1.child_fd,p2.child_fd,p3.child_fd,p4.child_fd)
|
fd_t1 = (p1.child_fd,p2.child_fd,p3.child_fd,p4.child_fd)
|
||||||
p1.expect(wexpect.EOF)
|
p1.expect(wexpect.EOF)
|
||||||
p2.expect(wexpect.EOF)
|
p2.expect(wexpect.EOF)
|
||||||
@ -52,10 +52,10 @@ class TestCaseDestructor(PexpectTestCase.PexpectTestCase):
|
|||||||
gc.collect()
|
gc.collect()
|
||||||
time.sleep(2) # Some platforms are slow at gc... Solaris!
|
time.sleep(2) # Some platforms are slow at gc... Solaris!
|
||||||
|
|
||||||
p1 = 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)
|
p2 = wexpect.spawn('"%s" hello_world.py' % self.PYTHONBIN)
|
||||||
p3 = 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)
|
p4 = wexpect.spawn('"%s" hello_world.py' % self.PYTHONBIN)
|
||||||
fd_t2 = (p1.child_fd,p2.child_fd,p3.child_fd,p4.child_fd)
|
fd_t2 = (p1.child_fd,p2.child_fd,p3.child_fd,p4.child_fd)
|
||||||
p1.kill(9)
|
p1.kill(9)
|
||||||
p2.kill(9)
|
p2.kill(9)
|
||||||
@ -68,10 +68,10 @@ class TestCaseDestructor(PexpectTestCase.PexpectTestCase):
|
|||||||
gc.collect()
|
gc.collect()
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
|
|
||||||
p1 = 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)
|
p2 = wexpect.spawn('"%s" hello_world.py' % self.PYTHONBIN)
|
||||||
p3 = 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)
|
p4 = wexpect.spawn('"%s" hello_world.py' % self.PYTHONBIN)
|
||||||
fd_t3 = (p1.child_fd,p2.child_fd,p3.child_fd,p4.child_fd)
|
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))
|
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))
|
||||||
|
Loading…
Reference in New Issue
Block a user