Skip to content

Test: Mark the async tests that no other open change touches (Part 1/2) - #179

Open
AmaadMartin wants to merge 1 commit into
mainfrom
fix/async-test-marker-hygiene-part1
Open

Test: Mark the async tests that no other open change touches (Part 1/2)#179
AmaadMartin wants to merge 1 commit into
mainfrom
fix/async-test-marker-hygiene-part1

Conversation

@AmaadMartin

@AmaadMartin AmaadMartin commented Aug 8, 2026

Copy link
Copy Markdown
Owner

Please ensure you have read the contribution guide before creating a pull request.

Link to Issue or Description of Change

  1. Link to an existing issue (if applicable):
    N/A

  2. Or, if no issue exists, describe the change:

Problem: pyproject.toml:342 sets asyncio_mode = "auto", so pytest-asyncio adopts async tests implicitly. pytest-asyncio defaults to strict mode instead. Any consumer that does not read our ini_options loses those tests. These six files hold 46 unmarked async tests.

Solution: I added an explicit @pytest.mark.asyncio to each of them. The marker is inert in auto mode, so CI behaviour does not change.

Collision check: I ran gh pr list --repo AmaadMartin/adk-python --state open --limit 100 and read the file list of every adjacent pull request. Thirteen open pull requests (#82, #105, #140-#148, #177, #178) mark async tests in other directories. None of them touches these six files, so this part stacks on nothing and can merge on its own. Part 2 (#180) covers the remaining 37 files and then switches asyncio_mode to strict, so the runner enforces the rule from that point on.

Testing Plan

Please describe the tests that you ran to verify your changes. This is required for all PRs that are not small documentation or typo fixes.

Unit Tests:
[x] I have added or updated unit tests for my change.
[x] All unit tests pass locally.

The six files behave identically in both asyncio modes now. Before this change they did not.

# before: pytest 9.1.1, pytest-asyncio 1.4.0
pytest <the 6 files> -o asyncio_mode=strict -q   -> 50 failed, 53 passed
pytest <the 6 files> -q                          -> 103 passed

# after
pytest <the 6 files> -o asyncio_mode=strict -q   -> 103 passed
pytest <the 6 files> -q                          -> 103 passed

The 50 failures are the proof that these tests were dead in strict mode. Fifty test items come from 46 test functions because four are parametrized.

Manual End-to-End (E2E) Tests:

uv sync --extra test --extra eval
uv run pytest tests/unittests/cli/plugins/test_replay_plugin.py \
  tests/unittests/cli/test_cleanup_unused_files.py \
  tests/unittests/plugins/test_auto_tracing_helpers.py \
  tests/unittests/plugins/test_logging_plugin.py \
  tests/unittests/plugins/test_reflect_retry_utils.py \
  tests/unittests/skills/test__utils.py -q
uv run pytest <same files> -o asyncio_mode=strict -q

Both runs must report the same counts. pre-commit run --from-ref main --to-ref HEAD passes, so isort and pyink accept the 47 inserted lines.

CI on the pushed commit. Unit Tests pass on Python 3.10 through 3.14. Mypy Check passes on 3.10 through 3.13, and the A2A v0.3 Tests pass on 3.10 through 3.14.

Pre-commit Linter fails, and that failure is not mine. The update-constraints hook regenerates all five constraints-*.txt files because it recomputes --exclude-newer from the current date, so it rewrites the committed 2026-07-24 pin to 2026-08-04. Unrelated pull requests on this fork fail the same hook the same way, for example #177. Every hook that could react to this diff passes: isort, pyink, addlicense and the ADK Compliance Checks. I left the constraints files alone because regenerating them is out of scope here, and #163 already targets that hook.

Checklist

[x] I have read the CONTRIBUTING.md document.
[x] I have performed a self-review of my own code.
[x] I have commented my code, particularly in hard-to-understand areas.
[x] I have added tests that prove my fix is effective or that my feature works.
[x] New and existing unit tests pass locally with my changes.

The suite relies on asyncio_mode = "auto" in pyproject.toml. pytest-asyncio
defaults to strict mode, where an unmarked async test errors out. These six
files hold 46 such tests. In strict mode they produce 50 failures before this
change and none after it.

Explicit markers are inert in auto mode, so CI behaviour does not change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant