File tree Expand file tree Collapse file tree 2 files changed +6
-11
lines changed Expand file tree Collapse file tree 2 files changed +6
-11
lines changed Original file line number Diff line number Diff line change @@ -28,4 +28,6 @@ build-backend = "hatchling.build"
28
28
29
29
[tool .pytest .ini_options ]
30
30
asyncio_mode = " strict"
31
- testpaths = " tests"
31
+ testpaths = " tests"
32
+ # Set default event loop scope for async tests
33
+ asyncio_default_fixture_loop_scope = " function"
Original file line number Diff line number Diff line change 1
1
import pytest
2
- import asyncio
3
2
4
- # Configure pytest-asyncio to use function scope
3
+ # Configure pytest-asyncio
5
4
def pytest_configure (config ):
6
- config .option .asyncio_mode = "strict"
7
-
8
- @pytest .fixture (scope = "function" )
9
- def event_loop ():
10
- """Create a new event loop for each test case"""
11
- loop = asyncio .new_event_loop ()
12
- yield loop
13
- loop .close ()
5
+ """Configure pytest-asyncio defaults"""
6
+ config .option .asyncio_mode = "strict"
You can’t perform that action at this time.
0 commit comments