From 8c00e1a6957e87c10f67b6a8487b1ce33c0889eb Mon Sep 17 00:00:00 2001 From: Sean Whalen <44679+seanthegeek@users.noreply.github.com> Date: Mon, 9 Nov 2026 15:40:09 -0500 Subject: [PATCH] Make the PostgreSQL output test independent of psycopg 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)