Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions packages/python-sdk/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,16 @@ async def factory(*, template_name: str = template, **kwargs):

yield factory

for sandbox in sandboxes:
if getattr(request.node, "_test_failed", False):
if getattr(request.node, "_test_failed", False):
for sandbox in sandboxes:
print(f"\n[TEST FAILED] Sandbox ID: {sandbox.sandbox_id}")
try:
await sandbox.kill()
except Exception:
pass

results = await asyncio.gather(
*(sandbox.kill() for sandbox in sandboxes), return_exceptions=True
)
for sandbox, result in zip(sandboxes, results):
if isinstance(result, BaseException):
print(f"\n[TEARDOWN FAILED] Sandbox ID: {sandbox.sandbox_id}: {result!r}")


@pytest_asyncio.fixture
Expand Down
Loading