Poll DescribeTable until status is ACTIVE. Shared helper — import from conftest instead of duplicating per-module.
(client, table_name: str, timeout: float = 120.0)
| 78 | |
| 79 | |
| 80 | def wait_for_active(client, table_name: str, timeout: float = 120.0) -> None: |
| 81 | """Poll DescribeTable until status is ACTIVE. |
| 82 | |
| 83 | Shared helper — import from conftest instead of duplicating per-module. |
| 84 | """ |
| 85 | interval = _poll_interval() |
| 86 | deadline = time.monotonic() + timeout |
| 87 | while time.monotonic() < deadline: |
| 88 | resp = client.describe_table(TableName=table_name) |
| 89 | if resp["Table"]["TableStatus"] == "ACTIVE": |
| 90 | return |
| 91 | time.sleep(interval) |
| 92 | raise TimeoutError(f"Table {table_name} did not become ACTIVE within {timeout}s") |
| 93 | @pytest.fixture() |
| 94 | def create_and_cleanup_table(dynamodb_client, unique_table_name): |
| 95 | """Create a table and ensure it's deleted after the test (REQ-TEST-005).""" |
no test coverage detected