mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-04 08:24:40 +01:00
Add process to avoid overwrite files that specifed in options
This commit is contained in:
parent
4870de6e51
commit
bb75d555fa
2 changed files with 18 additions and 4 deletions
|
@ -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
|
||||||
|
|
|
@ -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)]
|
||||||
|
|
Loading…
Add table
Reference in a new issue