From 4296a61b9a6cc562380c2e333bd9c3d33d772f50 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 19 Jun 2017 09:19:02 +0200 Subject: [PATCH] tests: Clean up check_history --- tests/end2end/features/test_history_bdd.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/end2end/features/test_history_bdd.py b/tests/end2end/features/test_history_bdd.py index f5639f5f3..319e36aee 100644 --- a/tests/end2end/features/test_history_bdd.py +++ b/tests/end2end/features/test_history_bdd.py @@ -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