From: Mike Bayer Date: Fri, 21 Jun 2019 19:23:52 +0000 (-0400) Subject: Register pytest assertion rewriting on sqlalchemy.testing.assertions X-Git-Tag: rel_1_3_6~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=424294156ca1caa885d39ad8b30693ab21366e59;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Register pytest assertion rewriting on sqlalchemy.testing.assertions Since our various eq_(), ne_() etc. functions use assert, pytest can rewrite this module using its enhanced string reporting. very helpful for comparing SQL strings Change-Id: Ia71328401fd7965bcb14eb1ccea0dc48a8f2c3ea (cherry picked from commit 6da5242953feffac7be29ecab256de372ffc1d31) --- diff --git a/lib/sqlalchemy/testing/plugin/pytestplugin.py b/lib/sqlalchemy/testing/plugin/pytestplugin.py index e0335c1357..7e144dd732 100644 --- a/lib/sqlalchemy/testing/plugin/pytestplugin.py +++ b/lib/sqlalchemy/testing/plugin/pytestplugin.py @@ -72,6 +72,8 @@ def pytest_addoption(parser): def pytest_configure(config): + pytest.register_assert_rewrite("sqlalchemy.testing.assertions") + if hasattr(config, "slaveinput"): plugin_base.restore_important_follower_config(config.slaveinput) plugin_base.configure_follower(config.slaveinput["follower_ident"])