sqlalchemy-pytest 0.1.1__tar.gz → 0.2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sqlalchemy-pytest
3
- Version: 0.1.1
3
+ Version: 0.2.1
4
4
  License: MIT
5
5
  Author-email: Doctor <thirvondukr@gmail.com>
6
6
  Requires-Python: >=3.10
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "sqlalchemy-pytest"
3
- version = "0.1.1"
3
+ version = "0.2.1"
4
4
  description = ""
5
5
  authors = [
6
6
  { name = "Doctor", email = "thirvondukr@gmail.com" },
@@ -71,7 +71,7 @@ precision = 2
71
71
 
72
72
  [tool.commitizen]
73
73
  name = "cz_conventional_commits"
74
- version = "0.1.1"
74
+ version = "0.2.1"
75
75
  tag_format = "$version"
76
76
  version_files = [
77
77
  "sqlalchemy_pytest/__init__.py",
@@ -0,0 +1 @@
1
+ __version__ = "0.2.1"
@@ -1,6 +1,6 @@
1
1
  from __future__ import annotations
2
2
 
3
- from collections.abc import AsyncGenerator, AsyncIterable
3
+ from collections.abc import AsyncGenerator, AsyncIterable, AsyncIterator
4
4
  from typing import TYPE_CHECKING, cast
5
5
 
6
6
  import pytest
@@ -73,8 +73,12 @@ async def _sqlalchemy_create_database(
73
73
 
74
74
 
75
75
  @pytest.fixture(scope="session")
76
- def sqlalchemy_pytest_engine(sqlalchemy_pytest_database_url: str) -> AsyncEngine:
77
- return create_async_engine(sqlalchemy_pytest_database_url)
76
+ async def sqlalchemy_pytest_engine(
77
+ sqlalchemy_pytest_database_url: str,
78
+ ) -> AsyncIterator[AsyncEngine]:
79
+ engine = create_async_engine(sqlalchemy_pytest_database_url)
80
+ yield engine
81
+ await engine.dispose()
78
82
 
79
83
 
80
84
  @pytest.fixture(scope="session")
@@ -1 +0,0 @@
1
- __version__ = "0.1.1"