Skip to content

Commit 0791a8f

Browse files
committed
More run-tests.sh fixes
1 parent 90b4693 commit 0791a8f

File tree

4 files changed

+11
-13
lines changed

4 files changed

+11
-13
lines changed

.evergreen/run-tests.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -275,22 +275,22 @@ if [ -z "$GREEN_FRAMEWORK" ]; then
275275
ASYNC_PYTEST_ARGS=("-m asyncio and $TEST_SUITES" "--junitxml=xunit-results/TEST-asyncresults.xml" "${PYTEST_ARGS[@]}")
276276
fi
277277
PYTEST_ARGS=("-m $TEST_SUITES and not asyncio" "${PYTEST_ARGS[@]}")
278+
else
279+
ASYNC_PYTEST_ARGS=("-m asyncio" "--junitxml=xunit-results/TEST-asyncresults.xml" "${PYTEST_ARGS[@]}")
278280
fi
279281
# shellcheck disable=SC2048
280282
uv run ${UV_ARGS[*]} pytest "${PYTEST_ARGS[@]}"
281283

282284
# Workaround until unittest -> pytest conversion is complete
283-
if [ -n "$TEST_SUITES" ]; then
284-
set +o errexit
285+
set +o errexit
286+
# shellcheck disable=SC2048
287+
uv run ${UV_ARGS[*]} pytest "${ASYNC_PYTEST_ARGS[@]}" "--collect-only"
288+
collected=$?
289+
set -o errexit
290+
# If we collected at least one async test, run all collected tests
291+
if [ $collected -ne 5 ]; then
285292
# shellcheck disable=SC2048
286-
uv run ${UV_ARGS[*]} pytest "${ASYNC_PYTEST_ARGS[@]}" "--collect-only"
287-
collected=$?
288-
set -o errexit
289-
# If we collected at least one async test, run all collected tests
290-
if [ $collected -ne 5 ]; then
291-
# shellcheck disable=SC2048
292-
uv run ${UV_ARGS[*]} pytest "${ASYNC_PYTEST_ARGS[@]}"
293-
fi
293+
uv run ${UV_ARGS[*]} pytest "${ASYNC_PYTEST_ARGS[@]}"
294294
fi
295295
else
296296
# shellcheck disable=SC2048

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ zstd = ["requirements/zstd.txt"]
9494

9595
[tool.pytest.ini_options]
9696
minversion = "7"
97-
addopts = ["-ra", "--strict-config", "--strict-markers", "--junitxml=xunit-results/TEST-results.xml", "-m default or default_async"]
97+
addopts = ["-ra", "--strict-config", "--strict-markers", "--junitxml=xunit-results/TEST-results.xml", "-m default or default_async and not asyncio"]
9898
testpaths = ["test"]
9999
log_cli_level = "INFO"
100100
faulthandler_timeout = 1500

test/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
sanitize_reply,
5151
)
5252

53-
from pymongo.lock import _create_lock
5453
from pymongo.uri_parser import parse_uri
5554

5655
try:

test/asynchronous/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
sanitize_reply,
5151
)
5252

53-
from pymongo.lock import _async_create_lock
5453
from pymongo.uri_parser import parse_uri
5554

5655
try:

0 commit comments

Comments
 (0)