Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps-dev): bump pytest to 8.22 and pytest-asyncio to 0.23.7 #269

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
644 changes: 334 additions & 310 deletions poetry.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ python-semantic-release = "^9.8.3"
black = "^24.4.2"
isort = "^5.12.0"
pre-commit = "^3.5.0"
pytest = "^8.1.1"
pytest-asyncio = "^0.21.0"
pytest = "^8.2.2"
pytest-asyncio = "^0.23.7"
pytest-cov = "^5.0.0"
python-dotenv = "^1.0.0"
Sphinx = "^7.1.2"
Expand Down
9 changes: 6 additions & 3 deletions tests/_async/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import asyncio
import os
from typing import AsyncGenerator, Generator

import pytest
from dotenv import load_dotenv
Expand All @@ -14,13 +15,15 @@ def pytest_configure(config) -> None:


@pytest.fixture(scope="package")
def event_loop() -> asyncio.AbstractEventLoop:
def event_loop() -> Generator[asyncio.AbstractEventLoop]:
"""Returns an event loop for the current thread"""
return asyncio.get_event_loop_policy().get_event_loop()
loop = asyncio.get_event_loop_policy().get_event_loop()
yield loop
loop.close()


@pytest.fixture(scope="package")
async def storage() -> AsyncStorageClient:
async def storage() -> AsyncGenerator[AsyncStorageClient]:
url = os.environ.get("SUPABASE_TEST_URL")
assert url is not None, "Must provide SUPABASE_TEST_URL environment variable"
key = os.environ.get("SUPABASE_TEST_KEY")
Expand Down
10 changes: 6 additions & 4 deletions tests/_async/test_client.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import annotations

from dataclasses import dataclass
from typing import TYPE_CHECKING
from typing import TYPE_CHECKING, AsyncGenerator, Generator
from uuid import uuid4

import pytest
Expand Down Expand Up @@ -81,7 +81,7 @@ async def bucket(storage: AsyncStorageClient, uuid_factory: Callable[[], str]) -
@pytest.fixture(scope="module")
async def public_bucket(
storage: AsyncStorageClient, uuid_factory: Callable[[], str]
) -> str:
) -> AsyncGenerator[str]:
"""Creates a test public bucket which will be used in the whole storage tests run and deleted at the end"""
bucket_id = uuid_factory()

Expand All @@ -100,15 +100,17 @@ async def public_bucket(


@pytest.fixture(scope="module")
def storage_file_client(storage: AsyncStorageClient, bucket: str) -> AsyncBucketProxy:
def storage_file_client(
storage: AsyncStorageClient, bucket: str
) -> Generator[AsyncBucketProxy]:
"""Creates the storage file client for the whole storage tests run"""
yield storage.from_(bucket)


@pytest.fixture(scope="module")
def storage_file_client_public(
storage: AsyncStorageClient, public_bucket: str
) -> AsyncBucketProxy:
) -> Generator[AsyncBucketProxy]:
"""Creates the storage file client for the whole storage tests run"""
yield storage.from_(public_bucket)

Expand Down
9 changes: 6 additions & 3 deletions tests/_sync/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import asyncio
import os
from typing import Generator

import pytest
from dotenv import load_dotenv
Expand All @@ -14,13 +15,15 @@ def pytest_configure(config) -> None:


@pytest.fixture(scope="package")
def event_loop() -> asyncio.AbstractEventLoop:
def event_loop() -> Generator[asyncio.AbstractEventLoop]:
"""Returns an event loop for the current thread"""
return asyncio.get_event_loop_policy().get_event_loop()
loop = asyncio.get_event_loop_policy().get_event_loop()
yield loop
loop.close()


@pytest.fixture(scope="package")
def storage() -> SyncStorageClient:
def storage() -> Generator[SyncStorageClient]:
url = os.environ.get("SUPABASE_TEST_URL")
assert url is not None, "Must provide SUPABASE_TEST_URL environment variable"
key = os.environ.get("SUPABASE_TEST_KEY")
Expand Down
12 changes: 8 additions & 4 deletions tests/_sync/test_client.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import annotations

from dataclasses import dataclass
from typing import TYPE_CHECKING
from typing import TYPE_CHECKING, Generator
from uuid import uuid4

import pytest
Expand Down Expand Up @@ -79,7 +79,9 @@ def bucket(storage: SyncStorageClient, uuid_factory: Callable[[], str]) -> str:


@pytest.fixture(scope="module")
def public_bucket(storage: SyncStorageClient, uuid_factory: Callable[[], str]) -> str:
def public_bucket(
storage: SyncStorageClient, uuid_factory: Callable[[], str]
) -> Generator[str]:
"""Creates a test public bucket which will be used in the whole storage tests run and deleted at the end"""
bucket_id = uuid_factory()

Expand All @@ -98,15 +100,17 @@ def public_bucket(storage: SyncStorageClient, uuid_factory: Callable[[], str]) -


@pytest.fixture(scope="module")
def storage_file_client(storage: SyncStorageClient, bucket: str) -> SyncBucketProxy:
def storage_file_client(
storage: SyncStorageClient, bucket: str
) -> Generator[SyncBucketProxy]:
"""Creates the storage file client for the whole storage tests run"""
yield storage.from_(bucket)


@pytest.fixture(scope="module")
def storage_file_client_public(
storage: SyncStorageClient, public_bucket: str
) -> SyncBucketProxy:
) -> Generator[SyncBucketProxy]:
"""Creates the storage file client for the whole storage tests run"""
yield storage.from_(public_bucket)

Expand Down
Loading