mirror of
https://github.com/gentoo-mirror/guru.git
synced 2026-07-16 02:23:16 -04:00
dev-python/b2sdk: migrate to pytest-lazy-fixtures
dev-python/pytest-lazy-fixture is broken with >=pytest-8 and replaced by dev-python/pytest-lazy-fixtures. Signed-off-by: Takuya Wakazono <pastalian46@gmail.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
# Copyright 2021-2022 Gentoo Authors
|
||||
# Copyright 2021-2024 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=7
|
||||
EAPI=8
|
||||
|
||||
DISTUTILS_USE_PEP517="pdm-backend"
|
||||
PYTHON_COMPAT=( python3_10 python3_11 python3_12 )
|
||||
@@ -33,11 +33,16 @@ distutils_enable_tests pytest
|
||||
BDEPEND+=" test? (
|
||||
$(python_gen_cond_dep '
|
||||
>=dev-python/pytest-mock-3.6.1[${PYTHON_USEDEP}]
|
||||
>=dev-python/pytest-lazy-fixture-0.6.3[${PYTHON_USEDEP}]
|
||||
dev-python/pytest-lazy-fixtures[${PYTHON_USEDEP}]
|
||||
>=dev-python/tqdm-4.66.2[${PYTHON_USEDEP}]
|
||||
')
|
||||
)"
|
||||
|
||||
PATCHES=(
|
||||
# migrate from pytest-lazy-fixture to pytest-lazy-fixtures
|
||||
"${FILESDIR}/${P}-lazy-fixtures.patch"
|
||||
)
|
||||
|
||||
# These tests seem to require some b2 authentication (they're integration tests
|
||||
# so this is not unreasonable)
|
||||
EPYTEST_DESELECT=(
|
||||
|
||||
56
dev-python/b2sdk/files/b2sdk-2.3.0-lazy-fixtures.patch
Normal file
56
dev-python/b2sdk/files/b2sdk-2.3.0-lazy-fixtures.patch
Normal file
@@ -0,0 +1,56 @@
|
||||
Migrate from pytest-lazy-fixture to pytest-lazy-fixtures.
|
||||
https://github.com/Backblaze/b2-sdk-python/issues/484
|
||||
--- a/test/unit/account_info/fixtures.py
|
||||
+++ b/test/unit/account_info/fixtures.py
|
||||
@@ -11,6 +11,7 @@ from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
from apiver_deps import InMemoryAccountInfo, SqliteAccountInfo
|
||||
+from pytest_lazy_fixtures import lf
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@@ -84,8 +85,8 @@ def sqlite_account_info(sqlite_account_info_factory):
|
||||
|
||||
@pytest.fixture(
|
||||
params=[
|
||||
- pytest.lazy_fixture('in_memory_account_info_factory'),
|
||||
- pytest.lazy_fixture('sqlite_account_info_factory'),
|
||||
+ lf('in_memory_account_info_factory'),
|
||||
+ lf('sqlite_account_info_factory'),
|
||||
]
|
||||
)
|
||||
def account_info_factory(request):
|
||||
@@ -94,8 +95,8 @@ def account_info_factory(request):
|
||||
|
||||
@pytest.fixture(
|
||||
params=[
|
||||
- pytest.lazy_fixture('in_memory_account_info'),
|
||||
- pytest.lazy_fixture('sqlite_account_info'),
|
||||
+ lf('in_memory_account_info'),
|
||||
+ lf('sqlite_account_info'),
|
||||
]
|
||||
)
|
||||
def account_info(request):
|
||||
--- a/test/unit/test_cache.py
|
||||
+++ b/test/unit/test_cache.py
|
||||
@@ -13,7 +13,7 @@ from dataclasses import dataclass
|
||||
|
||||
import pytest
|
||||
from apiver_deps import AuthInfoCache, DummyCache, InMemoryAccountInfo, InMemoryCache
|
||||
-from pytest_lazyfixture import lazy_fixture
|
||||
+from pytest_lazy_fixtures import lf
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@@ -32,8 +32,8 @@ def auth_info_cache():
|
||||
|
||||
|
||||
@pytest.fixture(
|
||||
- scope="class", params=[lazy_fixture('in_memory_cache'),
|
||||
- lazy_fixture('auth_info_cache')]
|
||||
+ params=[lf('in_memory_cache'),
|
||||
+ lf('auth_info_cache')]
|
||||
)
|
||||
def cache(request):
|
||||
return request.param
|
||||
Reference in New Issue
Block a user