Skip to content

Commit

Permalink
supybot-test: Add --clean-after option
Browse files Browse the repository at this point in the history
  • Loading branch information
progval committed Sep 4, 2023
1 parent 6b77859 commit f8dd8d7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/scripts/limnoria_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 '
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit f8dd8d7

Please sign in to comment.