14
0

- Add patch support-new-pytest-asyncio.patch:

* Support changes required by pytest-asyncio 1.0.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-vdirsyncer?expand=0&rev=47
This commit is contained in:
2025-07-22 04:29:58 +00:00
committed by Git OBS Bridge
parent 59de53fee5
commit bf2edc4fbf
3 changed files with 56 additions and 1 deletions

View File

@@ -0,0 +1,47 @@
Index: vdirsyncer-0.19.3/tests/conftest.py
===================================================================
--- vdirsyncer-0.19.3.orig/tests/conftest.py
+++ vdirsyncer-0.19.3/tests/conftest.py
@@ -59,12 +59,12 @@ else:
@pytest_asyncio.fixture
-async def aio_session(event_loop):
+async def aio_session():
async with aiohttp.ClientSession() as session:
yield session
@pytest_asyncio.fixture
-async def aio_connector(event_loop):
+async def aio_connector():
async with aiohttp.TCPConnector(limit_per_host=16) as conn:
yield conn
Index: vdirsyncer-0.19.3/tests/unit/test_metasync.py
===================================================================
--- vdirsyncer-0.19.3.orig/tests/unit/test_metasync.py
+++ vdirsyncer-0.19.3/tests/unit/test_metasync.py
@@ -1,4 +1,5 @@
from __future__ import annotations
+import asyncio
import hypothesis.strategies as st
import pytest
@@ -57,7 +58,7 @@ async def test_basic(monkeypatch):
@pytest_asyncio.fixture
@pytest.mark.asyncio
-async def conflict_state(request, event_loop):
+async def conflict_state(request):
a = MemoryStorage()
b = MemoryStorage()
status = {}
@@ -70,7 +71,7 @@ async def conflict_state(request, event_
assert await b.get_meta("foo") == "baz"
assert not status
- event_loop.run_until_complete(do_cleanup())
+ asyncio.new_event_loop().run_until_complete(do_cleanup())
request.addfinalizer(cleanup)