Skip to content
Merged
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
3 changes: 1 addition & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ make test

`make dev` also installs caldav and the embedded Xandikos and Radicale
servers, which the CalDAV backend's conformance tests run against (they are
skipped when missing). Radicale listens on its default port, 5232, whatever
caldav's test helper is told, so that port must be free.
skipped when missing).

### Testing against more CalDAV servers

Expand Down
13 changes: 1 addition & 12 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,7 @@ def serve(module: str, factory: str, config: dict[str, Any]) -> Iterator[Any]:
server = getattr(testing, factory)(config)
server.start()
yield server
# stop() leaves these open (RadicaleServer one end of its socketpair,
# XandikosServer its thread's event loop): https://github.com/python-caldav/caldav/issues/797
leftovers = [getattr(server, name, None) for name in ("shutdown_socket_out", "xapp_loop")]
server.stop()
for leftover in leftovers:
if leftover is not None:
leftover.close()


@pytest.fixture(scope="session")
Expand All @@ -53,9 +47,7 @@ def xandikos_server() -> Iterator[Any]:

@pytest.fixture(scope="session")
def radicale_server() -> Iterator[Any]:
# RadicaleServer does not pass its port on to Radicale, which then
# listens on its default, 5232: https://github.com/python-caldav/caldav/issues/797
yield from serve("radicale", "RadicaleServer", {})
yield from serve("radicale", "RadicaleServer", {"port": free_port()})


# --- caldav's test servers ----------------------------------------------
Expand Down Expand Up @@ -146,9 +138,6 @@ def pytest_collection_modifyitems(config: pytest.Config, items: list[pytest.Item
for name in (params.params.get(key) for key in ("caldav_server", "where")) if params else ():
if name in servers:
item.add_marker(pytest.mark.xdist_group(name))
# Radicale always listens on 5232, and stop() shuts down whichever one answers there
if "radicale_server" in getattr(item, "fixturenames", ()):
item.add_marker(pytest.mark.xdist_group("Radicale"))


def wait_out_search_cache(backend: Any, monkeypatch: pytest.MonkeyPatch) -> None:
Expand Down
Loading