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