Update verbosity when we create junit-style output report files (#608)

This commit is contained in:
Derek Keeler 2018-07-06 15:56:48 -07:00 committed by GitHub
parent 0be3795eb4
commit e33688d52b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -190,9 +190,12 @@ def run_tests(argv, env, coverage, junit_xml):
elif junit_xml:
from xmlrunner import XMLTestRunner # noqa
os.environ.update(env)
verbosity = 1
if '-v' in argv or '--verbose' in argv:
verbosity = 2
with open(junit_xml, 'wb') as output:
unittest.main(
testRunner=XMLTestRunner(output=output),
testRunner=XMLTestRunner(output=output, verbosity=verbosity),
module=None,
argv=argv,
)