about summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
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():