FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
pythonnative/tests/conftest.py at v0.41.0 · pythonnative/pythonnative · GitHub
pythonnative
pythonnative
Repository navigation
Code
Issues
11
(11)
Pull requests
5
(5)
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
pythonnative
/
tests
/
conftest.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
24 lines (17 loc) · 677 Bytes
Breadcrumbs
pythonnative
/
tests
/
conftest.py
Copy path
File metadata and controls
24 lines (17 loc) · 677 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
"""Shared test fixtures: framework-loop isolation between tests.
The framework runs one asyncio loop for the whole process. Tests
create tasks, resources, and timers on it; without cleanup those leak
into the next test. This autouse fixture closes the application loop after
every test (cancelling pending work) so each test starts with a fresh
loop.
"""
from
__future__
import
annotations
from
typing
import
Iterator
import
pytest
from
pythonnative
import
runtime
from
pythonnative
.
events
import
get_event_registry
@
pytest
.
fixture
(
autouse
=
True
)
def
_fresh_framework_loop
()
->
Iterator
[
None
]:
yield
runtime
.
_shutdown_for_tests
()
get_event_registry
().
reset
()
Back
|
FazBrowse Home
|
New Git URL