diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-09-14 21:41:13 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-09-14 21:41:13 -0400 |
commit | d7498cf4adb8ef9f35d1efa6dc747ac9eb489e60 (patch) | |
tree | de69b7ec88fef69c36704d2a7b06b1a0ffe0f17b /lib/sqlalchemy/testing/plugin/pytestplugin.py | |
parent | 7fd3f05805a7cf1ff1fa29ffcf375c4eea6627ba (diff) | |
download | sqlalchemy-d7498cf4adb8ef9f35d1efa6dc747ac9eb489e60.tar.gz |
- remove some crufty old testing options
- reestablish the "bootstrap" system of loading the test runners
in testing/plugin; using the updated approach we just came up with for
alembic. Coverage should be fixed now when running either py.test or
nose. fixes #3196
- upgrade tox.ini and start using a .coveragerc file
Diffstat (limited to 'lib/sqlalchemy/testing/plugin/pytestplugin.py')
-rw-r--r-- | lib/sqlalchemy/testing/plugin/pytestplugin.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/sqlalchemy/testing/plugin/pytestplugin.py b/lib/sqlalchemy/testing/plugin/pytestplugin.py index 005942913..4bbc8ed9a 100644 --- a/lib/sqlalchemy/testing/plugin/pytestplugin.py +++ b/lib/sqlalchemy/testing/plugin/pytestplugin.py @@ -1,7 +1,13 @@ +try: + # installed by bootstrap.py + import sqla_plugin_base as plugin_base +except ImportError: + # assume we're a package, use traditional import + from . import plugin_base + import pytest import argparse import inspect -from . import plugin_base import collections import itertools @@ -42,6 +48,8 @@ def pytest_configure(config): plugin_base.set_coverage_flag(bool(getattr(config.option, "cov_source", False))) + +def pytest_sessionstart(session): plugin_base.post_begin() if has_xdist: @@ -54,11 +62,11 @@ if has_xdist: plugin_base.memoize_important_follower_config(node.slaveinput) node.slaveinput["follower_ident"] = "test_%s" % next(_follower_count) - from . import provision + from sqlalchemy.testing import provision provision.create_follower_db(node.slaveinput["follower_ident"]) def pytest_testnodedown(node, error): - from . import provision + from sqlalchemy.testing import provision provision.drop_follower_db(node.slaveinput["follower_ident"]) |