@@ -268,20 +268,32 @@ if [ -z "$GREEN_FRAMEWORK" ]; then
268
268
PYTEST_ARGS=" -v --capture=tee-sys --durations=5 $TEST_ARGS "
269
269
if [ -n " $TEST_SUITES " ]; then
270
270
# Workaround until unittest -> pytest conversion is complete
271
+ if [[ " $TEST_SUITES " == * " default_async" * ]]; then
272
+ # shellcheck disable=SC2206
273
+ ASYNC_PYTEST_ARGS=(" -m asyncio" " --junitxml=xunit-results/TEST-asyncresults.xml" $PYTEST_ARGS )
274
+ else
275
+ # shellcheck disable=SC2206
276
+ ASYNC_PYTEST_ARGS=(" -m asyncio and $TEST_SUITES " " --junitxml=xunit-results/TEST-asyncresults.xml" $PYTEST_ARGS )
277
+ fi
271
278
# shellcheck disable=SC2206
272
- ASYNC_PYTEST_ARGS=(" -m asyncio and $TEST_SUITES " " --junitxml=xunit-results/TEST-asyncresults.xml" $PYTEST_ARGS )
273
- PYTEST_ARGS=" -m $TEST_SUITES $PYTEST_ARGS "
279
+ PYTEST_ARGS=(" -m $TEST_SUITES and not asyncio" $PYTEST_ARGS )
274
280
fi
275
281
# shellcheck disable=SC2048
276
- uv run ${UV_ARGS[*]} pytest $ PYTEST_ARGS
282
+ uv run ${UV_ARGS[*]} pytest " ${ PYTEST_ARGS[@]} "
277
283
278
284
# Workaround until unittest -> pytest conversion is complete
279
- if [ -z " $TEST_SUITES " ]; then
280
- # shellcheck disable=SC2206
281
- ASYNC_PYTEST_ARGS=(" -m asyncio" " --junitxml=xunit-results/TEST-asyncresults.xml" $PYTEST_ARGS )
285
+ if [ -n " $TEST_SUITES " ]; then
286
+ set +o errexit
287
+ # shellcheck disable=SC2048
288
+ uv run ${UV_ARGS[*]} pytest " ${ASYNC_PYTEST_ARGS[@]} " " --collect-only"
289
+ collected=$?
290
+ set -o errexit
291
+ # If we collected at least one async test, run all collected tests
292
+ if [ $collected -ne 5 ]; then
293
+ # shellcheck disable=SC2048
294
+ uv run ${UV_ARGS[*]} pytest " ${ASYNC_PYTEST_ARGS[@]} "
295
+ fi
282
296
fi
283
- # shellcheck disable=SC2048
284
- uv run ${UV_ARGS[*]} pytest " ${ASYNC_PYTEST_ARGS[@]} "
285
297
else
286
298
# shellcheck disable=SC2048
287
299
uv run ${UV_ARGS[*]} green_framework_test.py $GREEN_FRAMEWORK -v $TEST_ARGS
0 commit comments