Skip to content

Commit a7f3bae

Browse files
desioracclaude
andcommitted
fix(tests): replace get_event_loop() with async def in test_stripe_no_key
pytest-asyncio 1.4.0 closes the event loop between tests — sync tests calling asyncio.get_event_loop() now raise RuntimeError. Convert to async def + await, consistent with surrounding tests. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 676db20 commit a7f3bae

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

tests/test_payments.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,8 @@ async def test_stripe_no_payment_method():
110110
)
111111

112112

113-
def test_stripe_no_key():
113+
@pytest.mark.asyncio
114+
async def test_stripe_no_key():
114115
provider = StripeProvider("")
115-
# find_payment_method should fail with empty key
116-
import asyncio
117116
with pytest.raises(ValueError, match="Stripe key not configured"):
118-
asyncio.get_event_loop().run_until_complete(
119-
provider.find_payment_method("cus_123")
120-
)
117+
await provider.find_payment_method("cus_123")

0 commit comments

Comments
 (0)