Add process to avoid overwrite files that specifed in options

This commit is contained in:
virus 2019-04-29 17:07:09 +09:00
parent 4870de6e51
commit bb75d555fa
2 changed files with 18 additions and 4 deletions

View file

@ -36,7 +36,7 @@ jobs:
- script: | - script: |
call activate conda-test-$(python.version) call activate conda-test-$(python.version)
pip install . pip install .
xonsh run-tests.xsh --timeout=10 --junitxml=junit/test-results.xml xonsh run-tests.xsh --timeout=10 --junitxml=junit/test-results.%%d.xml
displayName: 'Tests' displayName: 'Tests'
# Publish build results # Publish build results

View file

@ -1,10 +1,24 @@
#!/usr/bin/env xonsh #!/usr/bin/env xonsh
import sys
args = sys.argv[1:]
def replace_args(num):
"""
Replace %d to num for avoid overwrite files
Example of args: --junitxml=junit/test-results.%d.xml
"""
return [
(arg % num) if "%d" in arg else arg
for arg in args]
$RAISE_SUBPROC_ERROR = True $RAISE_SUBPROC_ERROR = True
run_separately = [ run_separately = [
'tests/test_ptk_highlight.py', 'tests/test_ptk_highlight.py',
] ]
![pytest @($ARGS[1:]) --ignore @(run_separately)] ![pytest @(replace_args(0)) --ignore @(run_separately)]
for fname in run_separately: for index, fname in enumerate(run_separately):
![pytest @($ARGS[1:]) @(fname)] ![pytest @(replace_args(index+1)) @(fname)]