about summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authortoonn <toonn@toonn.io>2021-07-17 23:17:59 +0200
committertoonn <toonn@toonn.io>2021-07-20 23:17:45 +0200
commitc0ff7e6e238fd9b3b7fbc13e55be6c0aa9ff8921 (patch)
tree8ce8654de8e957758f51efc3d175579df1174a04 /tests
parent0678f5f0f7163ee1f099b5ff657d58d533b5fd9c (diff)
downloadranger-c0ff7e6e238fd9b3b7fbc13e55be6c0aa9ff8921.tar.gz
tests.manpage_completion: Use with
This test revealed an exception that wasn't covered in
`ranger/__init__.py` due to the refactor to a with-statement.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/manpage_completion_test.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/manpage_completion_test.py b/tests/manpage_completion_test.py
index b9504d06..f5e5c335 100755
--- a/tests/manpage_completion_test.py
+++ b/tests/manpage_completion_test.py
@@ -26,7 +26,8 @@ def get_path_of_man_page():
 
 def read_manpage():
     path = get_path_of_man_page()
-    return open(path, 'r').read()
+    with open(path, 'r') as man_page:
+        return man_page.read()
 
 
 def get_sections():