]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
move pytest assert rewrite to conftest.py
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 23 Sep 2019 20:33:04 +0000 (16:33 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 23 Sep 2019 20:34:57 +0000 (16:34 -0400)
this seems to be the best place to put this as it is guaranteed
before the module is imported.   this is for the benefit of
3rd party dialects that also would have this in their conftest.py,
so that they don't have to do the "bootstrap" loading hack.

Change-Id: Ieae5324240e04a7919df46f4fca03f8db7a2af81

lib/sqlalchemy/testing/plugin/pytestplugin.py
test/conftest.py

index 7e144dd732a2651537c25715ddaa78e0f4e34f09..e0335c1357931f14b4fc67be3ef01a81363e2079 100644 (file)
@@ -72,8 +72,6 @@ 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"])
index cdabc9785087e41bfb6ef66c4f9ee032b6f64ec8..6f7fe460d3e91d0cb0204b86a676fc2217779908 100755 (executable)
@@ -9,6 +9,10 @@ installs SQLAlchemy's testing plugin into the local environment.
 import os
 import sys
 
+import pytest
+
+pytest.register_assert_rewrite("sqlalchemy.testing.assertions")
+
 
 if not sys.flags.no_user_site:
     # this is needed so that test scenarios like "python setup.py test"