]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
psycopg2 NOTICE fixup
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 9 Jun 2019 14:59:23 +0000 (10:59 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 9 Jun 2019 15:59:32 +0000 (11:59 -0400)
commitaede49e4e1e3219600feec777e6e60ef287e8906
tree116c432f754e4f5268a101745d270d1da567409a
parent26e9d9f96509cdcc8f3729b16dc7ac144662aef5
psycopg2 NOTICE fixup

- don't call relatively expensive isEnabledFor(), just call _log_notices
- don't reset the list if it's empty
- fix the test to use a custom function to definitely create a notice, confirmed
that PG seems to no longer create the "implicit sequence" notices
- assert that the reset of the notices works too
- update the docs to illustrate for folks who haven't worked with logging before

Change-Id: I7291e647c177d338e0ad673f3106b4d503e4b3ea
(cherry picked from commit b0bf421f1b12eeedd77ec6c39df8e5e6cc1fcc3f)
lib/sqlalchemy/dialects/postgresql/psycopg2.py
test/dialect/postgresql/test_dialect.py