mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-18 14:40:51 +01:00
Added the option to turn on stderr logging.
This commit is contained in:
parent
173f99ca76
commit
b02cdef575
13
test/test.py
13
test/test.py
@ -50,7 +50,6 @@ import os.path
|
|||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
import debug
|
import debug
|
||||||
debug.stderr = False
|
|
||||||
|
|
||||||
import world
|
import world
|
||||||
world.startedAt = started
|
world.startedAt = started
|
||||||
@ -362,20 +361,32 @@ if __name__ == '__main__':
|
|||||||
parser.add_option('-v', '--verbose', action='store_true', default=False,
|
parser.add_option('-v', '--verbose', action='store_true', default=False,
|
||||||
help='Sets the verbose flag, printing extra information '
|
help='Sets the verbose flag, printing extra information '
|
||||||
'about each test that runs.')
|
'about each test that runs.')
|
||||||
|
parser.add_option('-s', '--stderr', action='store_true', default=False,
|
||||||
|
help='Sets debug.stderr to True, printing standard log '
|
||||||
|
'messages to stderr.')
|
||||||
(options, args) = parser.parse_args()
|
(options, args) = parser.parse_args()
|
||||||
if not args:
|
if not args:
|
||||||
args = map(path, glob.glob(os.path.join('test', 'test_*.py')))
|
args = map(path, glob.glob(os.path.join('test', 'test_*.py')))
|
||||||
|
|
||||||
if options.exclusions:
|
if options.exclusions:
|
||||||
for name in map(path, options.exclusions):
|
for name in map(path, options.exclusions):
|
||||||
args = [s for s in args if s != name]
|
args = [s for s in args if s != name]
|
||||||
|
|
||||||
if options.timeout:
|
if options.timeout:
|
||||||
PluginTestCase.timeout = options.timeout
|
PluginTestCase.timeout = options.timeout
|
||||||
|
|
||||||
if options.plugindirs:
|
if options.plugindirs:
|
||||||
conf.pluginDirs.extend(options.plugindirs)
|
conf.pluginDirs.extend(options.plugindirs)
|
||||||
|
|
||||||
if options.verbose:
|
if options.verbose:
|
||||||
world.myVerbose = True
|
world.myVerbose = True
|
||||||
else:
|
else:
|
||||||
world.myVerbose = False
|
world.myVerbose = False
|
||||||
|
|
||||||
|
if options.stderr:
|
||||||
|
debug.stderr = True
|
||||||
|
else:
|
||||||
|
debug.stderr = False
|
||||||
|
|
||||||
world.testing = True
|
world.testing = True
|
||||||
names = [os.path.splitext(os.path.basename(name))[0] for name in args]
|
names = [os.path.splitext(os.path.basename(name))[0] for name in args]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user