tests: Clean up check_history

This commit is contained in:
Florian Bruhin 2017-06-19 09:19:02 +02:00 committed by Ryan Roden-Corrent
parent 9f94f28181
commit 4296a61b9a

View File

@ -32,10 +32,9 @@ def check_history(quteproc, httpbin, tmpdir, expected):
quteproc.wait_for(category='message', loglevel=logging.INFO,
message='Dumped history to {}'.format(path))
with open(path, 'r', encoding='utf-8') as f:
with path.open('r', encoding='utf-8') as f:
# ignore access times, they will differ in each run
actual = '\n'.join(re.sub('^\\d+-?', '', line).strip()
for line in f.read().splitlines())
actual = '\n'.join(re.sub('^\\d+-?', '', line).strip() for line in f)
expected = expected.replace('(port)', str(httpbin.port))
assert actual == expected