Skip to content

Commit 8cd99d3

Browse files
committed
chore(tests): add uvloop for faster asyncio loop in tests
1 parent b48518a commit 8cd99d3

File tree

3 files changed

+654
-358
lines changed

3 files changed

+654
-358
lines changed

pyproject.toml

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "taskiq-postgres"
3-
version = "0.2.0"
3+
version = "0.6.0"
44
description = "PostgreSQL integration for taskiq"
55
summary = "PostgreSQL integration for taskiq"
66
readme = "README.md"
@@ -29,7 +29,7 @@ keywords = ["taskiq", "tasks", "distributed", "async", "postgresql"]
2929
authors = [
3030
{name = "Anfimov Dima", email = "lovesolaristics@gmail.com"}
3131
]
32-
requires-python = ">=3.10,<3.14"
32+
requires-python = ">=3.10,<3.15"
3333
dependencies = [
3434
"taskiq>=0.11.18",
3535
]
@@ -54,21 +54,31 @@ psycopg = [
5454

5555
[dependency-groups]
5656
dev = [
57-
# linting and formating
57+
{include-group = "lint"},
58+
{include-group = "test"},
59+
{include-group = "docs"},
60+
"prek>=0.2.8",
61+
]
62+
lint = [
5863
"ruff>=0.14.0",
64+
"bandit>=1.8.6",
65+
"codespell>=2.4.1",
66+
"zizmor>=1.15.2",
5967
# type check
6068
"mypy>=1.18.1",
6169
"asyncpg-stubs>=0.30.2",
62-
# tests
70+
]
71+
test = [
6372
"pytest>=8.4.2",
6473
"pytest-asyncio>=1.1.0",
6574
"pytest-cov>=7.0.0",
6675
# for database in tests
6776
"sqlalchemy-utils>=0.42.0",
68-
# pre-commit hooks
69-
"prek>=0.2.4",
70-
# docs
71-
"mkdocs-material>=9.6.21",
77+
# for faster asyncio loop in tests
78+
"uvloop>=0.21.0",
79+
]
80+
docs = [
81+
"mkdocs-material>=9.6.22",
7282
"mkdocstrings-python>=1.18.2",
7383
]
7484

@@ -90,7 +100,6 @@ markers = [
90100
"integration: marks tests with real infrastructure env",
91101
]
92102

93-
94103
[tool.coverage.report]
95104
exclude_lines = [
96105
"# pragma: no cover",
@@ -107,7 +116,6 @@ omit = [
107116
"tests/*"
108117
]
109118

110-
111119
[tool.ruff]
112120
line-length = 120
113121
target-version = "py310"

tests/conftest.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import pytest
2+
import uvloop
3+
4+
5+
@pytest.fixture(scope="session")
6+
def event_loop_policy():
7+
# Read for more details: https://pytest-asyncio.readthedocs.io/en/stable/how-to-guides/uvloop.html
8+
return uvloop.EventLoopPolicy()

0 commit comments

Comments
 (0)