MCPcopy
hub / github.com/psycopg/psycopg / test_connect_async_bad

Function test_connect_async_bad

tests/pq/test_pgconn.py:76–82  ·  view source on GitHub ↗
(dsn)

Source from the content-addressed store, hash-verified

74
75@pytest.mark.crdb("skip", reason="connects to any db name")
76def test_connect_async_bad(dsn):
77 parsed_dsn = {e.keyword: e.val for e in pq.Conninfo.parse(dsn.encode()) if e.val}
78 parsed_dsn[b"dbname"] = b"psycopg_test_not_for_real"
79 dsn = b" ".join(b"%s='%s'" % item for item in parsed_dsn.items())
80 conn = pq.PGconn.connect_start(dsn)
81 wait(conn, return_on=pq.PollingStatus.FAILED)
82 assert conn.status == pq.ConnStatus.BAD
83
84
85def test_finish(pgconn):

Callers

nothing calls this directly

Calls 4

waitFunction · 0.85
parseMethod · 0.45
joinMethod · 0.45
connect_startMethod · 0.45

Tested by

no test coverage detected