Don't write over JUnit tests results on re-runs

This commit is contained in:
Pedro Algarvio 2019-06-07 07:11:17 +01:00
parent 8e2b0c0c28
commit 70b3ccb7ac
No known key found for this signature in database
GPG key ID: BB36BF6584A298FF

View file

@ -879,6 +879,10 @@ def _pytest(session, coverage, cmd_args):
except CommandFailed:
# Re-run failed tests
session.log('Re-running failed tests')
for idx, parg in enumerate(cmd_args):
if parg.startswith('--junitxml='):
cmd_args[idx] = parg.replace('.xml', '-rerun-failed.xml')
cmd_args.append('--lf')
if coverage is True:
_run_with_coverage(session, 'coverage', 'run', '-m', 'py.test', *cmd_args)