Avoid using the |= operator on dictionaries, which is unsupported on
Python 3.8.
The test started mysteriously to fail... Turned out that it hadn't run
so far on Python 3.8 because the "latest" libpq was v16, but when it
switched to v17 it started to be executed.
def test_change_password(pgconn, dsn, role):
user, passwd = role
conninfo = {e.keyword: e.val for e in pq.Conninfo.parse(dsn.encode()) if e.val}
- conninfo |= {
- b"dbname": b"postgres",
- b"user": user,
- b"password": passwd,
- }
+ conninfo.update({b"dbname": b"postgres", b"user": user, b"password": passwd})
conn = pq.PGconn.connect(b" ".join(b"%s='%s'" % item for item in conninfo.items()))
assert conn.status == pq.ConnStatus.OK, conn.error_message