Skip to content

refactor(aws): migrate AWS actor tests to IsolatedAsyncioTestCase#663

Merged
LaikaN57 merged 1 commit intomainfrom
remove-tornado/08-tests-aws
Feb 26, 2026
Merged

refactor(aws): migrate AWS actor tests to IsolatedAsyncioTestCase#663
LaikaN57 merged 1 commit intomainfrom
remove-tornado/08-tests-aws

Conversation

@LaikaN57
Copy link
Member

Summary

Migrate 5 AWS test files (~200 test methods) from tornado.testing.AsyncTestCase to unittest.IsolatedAsyncioTestCase.

Files changed

  • actors/aws/test/test_base.py — 1 test class
  • actors/aws/test/test_iam.py — 5 test classes (~60 methods)
  • actors/aws/test/test_s3.py — 1 test class (~80 methods)
  • actors/aws/test/test_cloudformation.py — 4 test classes (~50 methods)
  • actors/aws/test/test_api_call_queue.py — 1 test class + rewrote @concurrent.run_on_executor test helper

Special handling (Lesson 2 from retro)

test_api_call_queue.py had a @concurrent.run_on_executor decorator on _mock_api_function_async(). This was rewritten to async def + loop.run_in_executor(), matching the production code pattern from PR 3/4. Also replaced concurrent.futures.ThreadPoolExecutor with the directly imported ThreadPoolExecutor.

Why this is safe

  • Same mechanical transformation as PR 7, applied to more files
  • tornado_value() helper from actors/test/helper.py works unchanged with await (pure Python, no tornado imports)
  • python -W error::RuntimeWarning verification catches any missed yieldawait conversions
  • Net deletion: -217 lines (decorator removal + import cleanup)

Test plan

  • make test passes (360 tests, 0 failures)
  • python -W error::RuntimeWarning -m pytest passes
  • ruff check clean

Part 8 of 10 in the tornado removal migration.

🤖 Generated with Claude Code

Replace tornado.testing.AsyncTestCase with unittest.IsolatedAsyncioTestCase
across 5 AWS test files (~200 test methods). Remove @testing.gen_test
decorators, convert def→async def, yield→await. Rewrite the
@concurrent.run_on_executor test helper in test_api_call_queue.py to
use async def + run_in_executor.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@LaikaN57 LaikaN57 marked this pull request as ready for review February 26, 2026 20:37
@LaikaN57 LaikaN57 merged commit 5bd5af9 into main Feb 26, 2026
4 of 5 checks passed
@LaikaN57 LaikaN57 deleted the remove-tornado/08-tests-aws branch February 26, 2026 20:40
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