Fix Python 2.6 support.

This commit is contained in:
Valentin Lorentz 2015-12-30 18:31:05 +01:00
parent 481ffbf797
commit 7765bf7307

View File

@ -211,8 +211,15 @@ if __name__ == '__main__':
test.suites.append(load(pluginModule.test)) test.suites.append(load(pluginModule.test))
suite = unittest.TestSuite(test.suites) suite = unittest.TestSuite(test.suites)
runner = unittest.TextTestRunner(verbosity=2, if options.fail_fast:
failfast=options.fail_fast) if sys.version_info < (2, 7, 0):
print('--fail-fast is not supported on Python 2.6.')
sys.exit(1)
else:
runner = unittest.TextTestRunner(verbosity=2,
failfast=True)
else:
runner = unittest.TextTestRunner(verbosity=2)
print('Testing began at %s (pid %s)' % (time.ctime(), os.getpid())) print('Testing began at %s (pid %s)' % (time.ctime(), os.getpid()))
if options.clean: if options.clean:
shutil.rmtree(conf.supybot.directories.log()) shutil.rmtree(conf.supybot.directories.log())