diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 18ed2df..aa2e01e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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 diff --git a/tests/conftest.py b/tests/conftest.py index b7a32df..6c9e50f 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -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") @@ -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 ---------------------------------------------- @@ -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: