]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Register pytest assertion rewriting on sqlalchemy.testing.assertions
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 21 Jun 2019 19:23:52 +0000 (15:23 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 21 Jun 2019 20:03:28 +0000 (16:03 -0400)
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)

lib/sqlalchemy/testing/plugin/pytestplugin.py

index e0335c1357931f14b4fc67be3ef01a81363e2079..7e144dd732a2651537c25715ddaa78e0f4e34f09 100644 (file)
@@ -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"])