mirror of
https://github.com/domainaware/parsedmarc.git
synced 2026-11-11 11:21:32 +00:00
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 <noreply@anthropic.com>
This commit is contained in:
1 parent
2ee209005b
commit
8c00e1a695
1 file changed
+3
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user