summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuncan Bellamy <dunk@denkimushi.com>2021-01-15 14:49:09 +0000
committerSviatoslav Sydorenko <wk@sydorenko.org.ua>2021-01-17 03:03:27 +0100
commit4a6287b73539adcb7b0ae72d69644a1ced1f7eaa (patch)
treedc12d743cd9c2439f6144f8a924df89f58f3bac4
parent59c0e19d7df8680e36afc96756dce72435121448 (diff)
downloadcherrypy-git-4a6287b73539adcb7b0ae72d69644a1ced1f7eaa.tar.gz
Close hanging fd in testHandlerToolConfigOverride
-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=[