File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -223,8 +223,10 @@ jobs:
223223 include :
224224 - os : macos-13
225225 python-version : " 3.10"
226+ unittest-args : []
226227 - os : macos-13
227228 python-version : " 3.9"
229+ unittest-args : []
228230 steps :
229231 - name : Checkout
230232 # see https://github.com/actions/checkout
@@ -236,6 +238,15 @@ jobs:
236238 uses : actions/setup-python@v5
237239 with :
238240 python-version : ${{ matrix.python-version }}
241+ - name : craft PY_UT_ARGS
242+ shell : python
243+ run : |-
244+ import sys
245+ PY_UT_ARGS=[]
246+ if sys.version_info >= (3, 12):
247+ PY_UT_ARGS.append('--durations=0')
248+ with open(os.environ['GITHUB_ENV'], 'a') as env_file:
249+ env_file.write(f'PY_UT_ARGS=${" ".join(PY_UT_ARGS)}\n')
239250 - name : Install poetry
240251 # see https://github.com/marketplace/actions/setup-poetry
241252 uses : Gr1N/setup-poetry@v9
@@ -246,7 +257,7 @@ jobs:
246257 - name : Ensure build successful
247258 run : poetry build
248259 - name : Run tox
249- run : poetry run tox r -e py -s false
260+ run : poetry run -- tox r -e py -s false -- $PY_UT_ARGS
250261 - name : Generate coverage reports
251262 if : ${{ failure() || success() }}
252263 shell : bash
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ commands_pre =
2626 poetry install --no-root -v
2727 poetry run pip freeze
2828commands =
29- poetry run coverage run --source =cyclonedx_py -m unittest discover -t . -s tests -v -- durations =0
29+ poetry run coverage run --source =cyclonedx_py -m unittest discover -t . -s tests -v {posargs}
3030setenv =
3131 PYTHONHASHSEED =0
3232 CDX_TEST_RECREATE_SNAPSHOTS ={env:CDX_TEST_RECREATE_SNAPSHOTS:}
You can’t perform that action at this time.
0 commit comments