diff options
author | Richard Darst <rkd@zgib.net> | 2009-09-12 03:15:47 (GMT) |
---|---|---|
committer | Richard Darst <rkd@zgib.net> | 2009-09-12 03:15:47 (GMT) |
commit | c90f88964dfb28a4a2cba0b6c68d63d8ce8588ae (patch) | |
tree | 58cce6c287cc138336c6758dea745ee9042d3731 | |
parent | affdec1e4b7849207c7721bc7d6d50298581693b (diff) |
Create ways for tests to disable meetingLocalConfig
- We have the __main__.running_tests that can disable it, for things
running in the same python process.
- We have an environment variable MEETBOT_RUNNING_TESTS for different
python processes.
darcs-hash:20090912031547-82ea9-2eaee7f221b6fc07e42fdd0bb04e4c11c6037154.gz
-rw-r--r-- | meeting.py | 4 | ||||
-rw-r--r-- | tests/run_test.py | 1 |
2 files changed, 5 insertions, 0 deletions
@@ -234,6 +234,10 @@ time.tzset() # load custom local configurations try: + import __main__ + if getattr(__main__, 'running_tests', False): raise ImportError + if 'MEETBOT_RUNNING_TESTS' in os.environ: raise ImportError + import meetingLocalConfig meetingLocalConfig = reload(meetingLocalConfig) if hasattr(meetingLocalConfig, 'Config'): diff --git a/tests/run_test.py b/tests/run_test.py index 9c2bb70..c503c24 100644 --- a/tests/run_test.py +++ b/tests/run_test.py @@ -8,6 +8,7 @@ import unittest import meeting running_tests = True +os.environ['MEETBOT_RUNNING_TESTS'] = '1' class MeetBotTest(unittest.TestCase): |