summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/testing/plugin/pytestplugin.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2014-07-27 18:46:20 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2014-07-27 18:46:20 -0400
commit54592942c4a9c3d6d891519082555f8081026445 (patch)
tree29abeff4dee0960284e03558ff464ffbf41cc784 /lib/sqlalchemy/testing/plugin/pytestplugin.py
parent35551841c522d8eb20f8e20243a5510de9d95dfc (diff)
downloadsqlalchemy-54592942c4a9c3d6d891519082555f8081026445.tar.gz
- add support for tags, including include/exclude support.
simplify tox again now that we can exclude tests more easily
Diffstat (limited to 'lib/sqlalchemy/testing/plugin/pytestplugin.py')
-rw-r--r--lib/sqlalchemy/testing/plugin/pytestplugin.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/sqlalchemy/testing/plugin/pytestplugin.py b/lib/sqlalchemy/testing/plugin/pytestplugin.py
index 7671c800c..fd0616327 100644
--- a/lib/sqlalchemy/testing/plugin/pytestplugin.py
+++ b/lib/sqlalchemy/testing/plugin/pytestplugin.py
@@ -32,6 +32,7 @@ def pytest_addoption(parser):
def pytest_configure(config):
if hasattr(config, "slaveinput"):
+ plugin_base.restore_important_follower_config(config.slaveinput)
plugin_base.configure_follower(
config.slaveinput["follower_ident"]
)
@@ -49,6 +50,9 @@ if has_xdist:
def pytest_configure_node(node):
# the master for each node fills slaveinput dictionary
# which pytest-xdist will transfer to the subprocess
+
+ plugin_base.memoize_important_follower_config(node.slaveinput)
+
node.slaveinput["follower_ident"] = "test_%s" % next(_follower_count)
from . import provision
provision.create_follower_db(node.slaveinput["follower_ident"])
@@ -100,12 +104,11 @@ def pytest_collection_modifyitems(session, config, items):
def pytest_pycollect_makeitem(collector, name, obj):
-
if inspect.isclass(obj) and plugin_base.want_class(obj):
return pytest.Class(name, parent=collector)
elif inspect.isfunction(obj) and \
- name.startswith("test_") and \
- isinstance(collector, pytest.Instance):
+ isinstance(collector, pytest.Instance) and \
+ plugin_base.want_method(collector.cls, obj):
return pytest.Function(name, parent=collector)
else:
return []