From 1c7f2785e566528d5e90151c96a2145297b6af5c Mon Sep 17 00:00:00 2001 From: Sean Whalen <44679+seanthegeek@users.noreply.github.com> Date: Mon, 9 Nov 2026 16:18:18 -0500 Subject: [PATCH] Make the PostgreSQL output test independent of psycopg (#944) testPostgreSQLExceptionsAreRecorded replaces PostgreSQLClient with a mock, but _init_output_clients() first checks postgres.psycopg and raises ConfigurationError when the extra is missing, so the client was never built and the saver mocks were never called. Patch psycopg with a stand-in so the test passes whether or not the postgresql extra is installed. Co-authored-by: Claude Sonnet 5.5 --- tests/test_cli.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/test_cli.py b/tests/test_cli.py index 3a9b54cf..d24d9953 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -10734,6 +10734,9 @@ class TestOutputDestinationExceptionsMarkTheBatchUnsaved(unittest.TestCase): "[postgresql]\nhost = db.example.com\n", {batch_key: [report]}, patch("parsedmarc.cli.postgres.PostgreSQLClient", client_cls), + # The startup guard checks the SDK, not the client class; + # without a stand-in the test needs the postgresql extra. + patch("parsedmarc.cli.postgres.psycopg", object()), ) client = client_cls.return_value getattr(client, saver).assert_called_once_with(report)