import importlib def test_connection_summary_is_host_only(monkeypatch): monkeypatch.setenv("DATABASE_URL", "postgres://demo:pw@db.test:5432/demo") db = importlib.import_module("db") assert db.connection_summary() == "db.test:5432/demo"