views:

68

answers:

0

hi, all, I have a python test script to test and launch several subprocesses and after some interval of time, terminate these subprocesses. e.g.

[username@machine workdir]python call_test.py

and inside one test case of this call_test.py, it is bit like this.

def test_launch_kill(self):
    p1 = subprocess.Popen("./exec1")
    threading.Timer(40, kill_proc, ()).start()

def kill_proc:
    os.kill(p1.pid, signal.SIGTERM)

my question is after the call_test.py program launches and terminates the process, it returns to the prompt [username@mahine workdir]. but then, I cannot input anything or repeat the previous command by using up-arrow. I mean the prompt seems to be unresponding. The only response is when I type "return" button, then it sends messages. e.g. if I type some random input like"ffsss", the messages are as follows.

Traceback (most recent call last): File "call_test.py", line 172, in ?
    unittest.main()
  File "/usr/lib/python2.4/unittest.py", line 758, in __init__
    self.parseArgs(argv) 
  File "/usr/lib/python2.4/unittest.py", line 785, in parseArgs
    self.createTests()
  File "/usr/lib/python2.4/unittest.py", line 791, in createTests
    self.module)
  File "/usr/lib/python2.4/unittest.py", line 556, in loadTestsFromNames
    suites = [self.loadTestsFromName(name, module) for name in names]
  File "/usr/lib/python2.4/unittest.py", line 532, in loadTestsFromName
    parent, obj = obj, getattr(obj, part)
AttributeError: 'module' object has no attribute 'ffsss'

could anyone explain what happens? why the prompt remains unresponding and why such kind of trackback from unittest?