V0.6 test api #1781

Closed
kdcis wants to merge 8 commits from v0.6-test-api into v0.6
Showing only changes of commit 9bf5c84c41 - Show all commits

View File

@ -84,7 +84,8 @@ class TestProcessProto(unittest.TestCase):
def _get_readline(cls, pfile): def _get_readline(cls, pfile):
pfile = os.path.join(cls.home, pfile) pfile = os.path.join(cls.home, pfile)
try: try:
return open(pfile, 'rb').readline().strip() with open(pfile, 'rb') as p:
return p.readline().strip()
except (OSError, IOError): except (OSError, IOError):
pass pass