diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2019-09-23 16:33:04 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2019-09-23 16:34:57 -0400 |
| commit | 48d22c040694bbc00bcd0e343770408648616bb6 (patch) | |
| tree | 0feae8b865ae0eedd680b08994572a4144df2806 | |
| parent | adb495503dab660f014cad0200491c854d2f6a50 (diff) | |
| download | sqlalchemy-48d22c040694bbc00bcd0e343770408648616bb6.tar.gz | |
move pytest assert rewrite to conftest.py
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
| -rw-r--r-- | lib/sqlalchemy/testing/plugin/pytestplugin.py | 2 | ||||
| -rwxr-xr-x | test/conftest.py | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/lib/sqlalchemy/testing/plugin/pytestplugin.py b/lib/sqlalchemy/testing/plugin/pytestplugin.py index 7e144dd73..e0335c135 100644 --- a/lib/sqlalchemy/testing/plugin/pytestplugin.py +++ b/lib/sqlalchemy/testing/plugin/pytestplugin.py @@ -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"]) diff --git a/test/conftest.py b/test/conftest.py index cdabc9785..6f7fe460d 100755 --- a/test/conftest.py +++ b/test/conftest.py @@ -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" |
