Skip to content

Commit

Permalink
Use pytest-asyncio
Browse files Browse the repository at this point in the history
  • Loading branch information
bswck committed Dec 8, 2023
1 parent 5075b6d commit 33d8009
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
22 changes: 20 additions & 2 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ tomlkit = "^0.12.3"
ruamel-yaml = "^0.18.5"

[tool.poetry.group.dev.dependencies]
pytest-asyncio = "^0.23.2"

[tool.poetry.group.dev-skeleton.dependencies]
mypy = "^1.7.0"
Expand Down
4 changes: 4 additions & 0 deletions tests/test_copy_context.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from contextvars import ContextVar

import pytest
from configzen.copy_context import (
copy_context_on_call,
copy_context_on_await,
Expand All @@ -19,6 +21,7 @@ def func() -> int:
assert cv.get() == 1


@pytest.mark.asyncio
async def test_copy_context_on_await() -> None:
cv = ContextVar("cv")
cv.set(1)
Expand All @@ -44,6 +47,7 @@ def func() -> int:
assert cv.get() == 1


@pytest.mark.asyncio
async def test_copy_and_await() -> None:
cv = ContextVar("cv")
cv.set(1)
Expand Down

0 comments on commit 33d8009

Please sign in to comment.