summaryrefslogtreecommitdiff
path: root/pecan/tests
diff options
context:
space:
mode:
authorRyan Petrello <lists@ryanpetrello.com>2013-03-01 07:58:48 -0800
committerRyan Petrello <lists@ryanpetrello.com>2013-03-01 07:58:48 -0800
commitc29e0591230ce825ceae6784ac519f5471821b5a (patch)
treeb07ab74769caa56be4b9b04f96c20ecff0ffd3f5 /pecan/tests
parentd78a4b22a4145ae46d6eb55325870ab863b0c86c (diff)
parent577a5b7c17b471631bd6397b1c2990dffdb29bc6 (diff)
downloadpecan-c29e0591230ce825ceae6784ac519f5471821b5a.tar.gz
Merge pull request #186 from alfredodeza/env_var
improve the tearDown method as it was contaminating the global config
Diffstat (limited to 'pecan/tests')
-rw-r--r--pecan/tests/test_conf.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/pecan/tests/test_conf.py b/pecan/tests/test_conf.py
index 772b466..ae590c7 100644
--- a/pecan/tests/test_conf.py
+++ b/pecan/tests/test_conf.py
@@ -284,6 +284,11 @@ class TestGlobalConfig(TestCase):
class TestConfFromEnv(TestCase):
+ #
+ # Note that there is a good chance of pollution if ``tearDown`` does not
+ # reset the configuration like this class does. If implementing new classes
+ # for configuration this tearDown **needs to be implemented**
+ #
def setUp(self):
self.conf_from_env = self.get_conf_from_env()
@@ -291,6 +296,11 @@ class TestConfFromEnv(TestCase):
def tearDown(self):
os.environ['PECAN_CONFIG'] = ''
+ from pecan import configuration
+ configuration.set_config(
+ dict(configuration.initconf()),
+ overwrite=True
+ )
def get_conf_from_env(self):
from pecan import configuration