diff --git a/src/log.py b/src/log.py index 0ec8ec20d..5c08fcbbc 100644 --- a/src/log.py +++ b/src/log.py @@ -52,6 +52,12 @@ import supybot.ircutils as ircutils deadlyExceptions = [KeyboardInterrupt, SystemExit] +### +# This is for testing, of course. Mostly is just disables the firewall code +# so exceptions can propagate. +### +testing = False + class Formatter(logging.Formatter): def formatTime(self, record, datefmt=None): return timestamp(record.created) @@ -220,6 +226,8 @@ def firewall(f, errorHandler=None): try: return f(self, *args, **kwargs) except Exception, e: + if testing: + raise logException(self) if errorHandler is not None: try: diff --git a/test/test.py b/test/test.py index cb525c845..51cd8644d 100755 --- a/test/test.py +++ b/test/test.py @@ -154,6 +154,7 @@ if __name__ == '__main__': if options.nonetwork: testsupport.network = False + log.testing = True world.testing = True names = [os.path.splitext(os.path.basename(name))[0] for name in args] names.sort() diff --git a/test/test_Misc.py b/test/test_Misc.py index 34f5d0e87..f5282f0e0 100644 --- a/test/test_Misc.py +++ b/test/test_Misc.py @@ -83,14 +83,6 @@ class MiscTestCase(ChannelPluginTestCase): m = self.getMsg('help list') # Misc.list and User.list. self.failIf(m.args[1].startswith('Error')) -## def testHelpStripsPrefixChars(self): -## try: -## original = str(conf.supybot.prefixChars) -## conf.supybot.prefixChars.set('@') -## self.assertHelp('help @list') -## finally: -## conf.supybot.prefixChars.set(original) - def testHelpIsCaseInsensitive(self): self.assertHelp('help LIST')