mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-18 22:51:01 +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,
|
parser.add_option('-c', '--clean', action='store_true', default=False,
|
||||||
dest='clean', help='Cleans the various data/conf/logs'
|
dest='clean', help='Cleans the various data/conf/logs'
|
||||||
'directories before running tests.')
|
'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',
|
parser.add_option('-t', '--timeout', action='store', type='float',
|
||||||
dest='timeout',
|
dest='timeout',
|
||||||
help='Sets the timeout, in seconds, for tests to return '
|
help='Sets the timeout, in seconds, for tests to return '
|
||||||
@ -239,6 +242,12 @@ def main():
|
|||||||
if hasattr(unittest, 'asserts'):
|
if hasattr(unittest, 'asserts'):
|
||||||
print('Total asserts: %s' % 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():
|
if result.wasSuccessful():
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user