Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Darst <rkd@zgib.net>2009-09-12 03:15:47 (GMT)
committer Richard Darst <rkd@zgib.net>2009-09-12 03:15:47 (GMT)
commitc90f88964dfb28a4a2cba0b6c68d63d8ce8588ae (patch)
tree58cce6c287cc138336c6758dea745ee9042d3731
parentaffdec1e4b7849207c7721bc7d6d50298581693b (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.py4
-rw-r--r--tests/run_test.py1
2 files changed, 5 insertions, 0 deletions
diff --git a/meeting.py b/meeting.py
index 9150c1a..88730b2 100644
--- a/meeting.py
+++ b/meeting.py
@@ -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):