refactor(aws): migrate AWS actor tests to IsolatedAsyncioTestCase#663
Merged
refactor(aws): migrate AWS actor tests to IsolatedAsyncioTestCase#663
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migrate 5 AWS test files (~200 test methods) from
tornado.testing.AsyncTestCasetounittest.IsolatedAsyncioTestCase.Files changed
actors/aws/test/test_base.py— 1 test classactors/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_executortest helperSpecial handling (Lesson 2 from retro)
test_api_call_queue.pyhad a@concurrent.run_on_executordecorator on_mock_api_function_async(). This was rewritten toasync def+loop.run_in_executor(), matching the production code pattern from PR 3/4. Also replacedconcurrent.futures.ThreadPoolExecutorwith the directly importedThreadPoolExecutor.Why this is safe
tornado_value()helper fromactors/test/helper.pyworks unchanged withawait(pure Python, no tornado imports)python -W error::RuntimeWarningverification catches any missedyield→awaitconversionsTest plan
make testpasses (360 tests, 0 failures)python -W error::RuntimeWarning -m pytestpassesruff checkcleanPart 8 of 10 in the tornado removal migration.
🤖 Generated with Claude Code