Skip to content

Commit

Permalink
Update test_base.py
Browse files Browse the repository at this point in the history
Fix coverage
  • Loading branch information
kigawas committed Jun 21, 2022
1 parent 0a49382 commit 3785217
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions tests/middleware/test_base.py
@@ -1,5 +1,4 @@
import contextvars
import traceback

import anyio
import pytest
Expand Down Expand Up @@ -90,13 +89,8 @@ def test_custom_middleware(test_client_factory):
def test_background_tasks(test_client_factory):
async def _sleep(identifier, delay):
print(identifier, "started")
try:
await anyio.sleep(delay)
print(identifier, "completed")
except BaseException:
print(identifier, "error")
traceback.print_exc()
raise
await anyio.sleep(delay)
print(identifier, "completed")

async def bg_task(request):
background_tasks = BackgroundTasks()
Expand Down

0 comments on commit 3785217

Please sign in to comment.