summaryrefslogtreecommitdiff
path: root/cherrypy/test/test_config.py
diff options
context:
space:
mode:
Diffstat (limited to 'cherrypy/test/test_config.py')
-rw-r--r--cherrypy/test/test_config.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/cherrypy/test/test_config.py b/cherrypy/test/test_config.py
index 5e880d87..ecd46019 100644
--- a/cherrypy/test/test_config.py
+++ b/cherrypy/test/test_config.py
@@ -221,8 +221,8 @@ class ConfigTests(helper.CPWebCase):
# the favicon in the page handler to be '../favicon.ico',
# but then overrode it in config to be './static/dirback.jpg'.
self.getPage('/favicon.ico')
- self.assertBody(open(os.path.join(localDir, 'static/dirback.jpg'),
- 'rb').read())
+ with open(os.path.join(localDir, 'static/dirback.jpg'), 'rb') as tf:
+ self.assertBody(tf.read())
def test_request_body_namespace(self):
self.getPage('/plain', method='POST', headers=[