mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-14 04:31:04 +01:00
supybot-test: Add --clean-after option
This commit is contained in:
parent
6b778598bb
commit
f8dd8d7642
@ -132,6 +132,9 @@ def main():
|
||||
parser.add_option('-c', '--clean', action='store_true', default=False,
|
||||
dest='clean', help='Cleans the various data/conf/logs'
|
||||
'directories before running tests.')
|
||||
parser.add_option('--clean-after', action='store_true', default=False,
|
||||
dest='clean_after', help='Cleans the various data/conf/logs'
|
||||
'directories after running tests.')
|
||||
parser.add_option('-t', '--timeout', action='store', type='float',
|
||||
dest='timeout',
|
||||
help='Sets the timeout, in seconds, for tests to return '
|
||||
@ -239,6 +242,12 @@ def main():
|
||||
if hasattr(unittest, 'asserts'):
|
||||
print('Total asserts: %s' % unittest.asserts)
|
||||
|
||||
if options.clean_after:
|
||||
log.setLevel(100) # don't log anything anymore
|
||||
shutil.rmtree(conf.supybot.directories.log())
|
||||
shutil.rmtree(conf.supybot.directories.conf())
|
||||
shutil.rmtree(conf.supybot.directories.data())
|
||||
|
||||
if result.wasSuccessful():
|
||||
sys.exit(0)
|
||||
else:
|
||||
|
Loading…
x
Reference in New Issue
Block a user