From 0c1df2847151c6e33b12c1e39dcfd0f85c258d64 Mon Sep 17 00:00:00 2001 From: Joel Rivera Date: Thu, 10 Mar 2016 00:35:56 -0600 Subject: Avoid the side effects of using `cherypy.config.environments` on `test_call_with_kwargs` test. --- cherrypy/test/test_config.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/cherrypy/test/test_config.py b/cherrypy/test/test_config.py index 491321dd..0508f92c 100644 --- a/cherrypy/test/test_config.py +++ b/cherrypy/test/test_config.py @@ -289,11 +289,17 @@ class CallablesInConfigTest(unittest.TestCase): from textwrap import dedent conf = dedent(""" [my] - value = dict(test_suite="OVERRIDE", **cherrypy.config.environments) + value = dict(foo="buzz", **cherrypy._test_dict) """) + test_dict = { + "foo": "bar", + "bar": "foo", + "fizz": "buzz" + } + cherrypy._test_dict = test_dict fp = compat.StringIO(conf) cherrypy.config.update(fp) - env = cherrypy.config.environments.copy() - env['test_suite'] = 'OVERRIDE' - self.assertEqual(cherrypy.config['my']['value']['test_suite'], 'OVERRIDE') - self.assertEqual(cherrypy.config['my']['value'], env) + test_dict['foo'] = 'buzz' + self.assertEqual(cherrypy.config['my']['value']['foo'], 'buzz') + self.assertEqual(cherrypy.config['my']['value'], test_dict) + del cherrypy._test_dict -- cgit v1.2.1