summaryrefslogtreecommitdiff
path: root/tests/test_html_formatter.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_html_formatter.py')
-rw-r--r--tests/test_html_formatter.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/tests/test_html_formatter.py b/tests/test_html_formatter.py
index 91225cd3..5b1b2576 100644
--- a/tests/test_html_formatter.py
+++ b/tests/test_html_formatter.py
@@ -25,11 +25,8 @@ import support
TESTFILE, TESTDIR = support.location(__file__)
-fp = io.open(TESTFILE, encoding='utf-8')
-try:
+with io.open(TESTFILE, encoding='utf-8') as fp:
tokensource = list(PythonLexer().get_tokens(fp.read()))
-finally:
- fp.close()
class HtmlFormatterTest(unittest.TestCase):