提交 60f9dc7a 编写于 作者: M Mikhail Korobov

TST fix file descriptor leak and a bad variable name in get_testlog

上级 75060d14
......@@ -53,11 +53,13 @@ def get_testenv():
def get_testlog():
"""Get Scrapy log of current test, ignoring the rest"""
with open("test.log", "rb") as fp:
loglines = fp.readlines()
thistest = []
loglines = open("test.log").readlines()
for l in loglines[::-1]:
thistest.append(l)
if "[-] -->" in l:
for line in loglines[::-1]:
thistest.append(line)
if "[-] -->" in line:
break
return "".join(thistest[::-1])
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册