mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-04-26 14:47:44 +00:00
Add asyncio to the storage backends and most of the codebase. A lot of it merely uses asyncio APIs, but still doesn't actually run several things concurrently internally. Further improvements will be added on top of these changes Thanks to Thomas Grainger (@graingert) for a few useful pointers related to asyncio.
27 lines
618 B
Python
27 lines
618 B
Python
import pytest
|
|
|
|
|
|
class ServerMixin:
|
|
@pytest.fixture
|
|
def get_storage_args(
|
|
self,
|
|
request,
|
|
tmpdir,
|
|
slow_create_collection,
|
|
xandikos_server,
|
|
aio_connector,
|
|
):
|
|
async def inner(collection="test"):
|
|
url = "http://127.0.0.1:8000/"
|
|
args = {"url": url, "connector": aio_connector}
|
|
|
|
if collection is not None:
|
|
args = await slow_create_collection(
|
|
self.storage_class,
|
|
args,
|
|
collection,
|
|
)
|
|
|
|
return args
|
|
|
|
return inner
|