Only firewall if we're not testing.

This commit is contained in:
Jeremy Fincher 2004-08-26 05:23:24 +00:00
parent 517a5909ea
commit bd306febf0
3 changed files with 9 additions and 8 deletions

View File

@ -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:

View File

@ -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()

View File

@ -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')