summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/testing/plugin/pytestplugin.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2020-03-12 19:44:37 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2020-03-12 19:50:15 -0400
commit993e6449e3f5f3532f6f5426b824718435ce6c6d (patch)
treed60617a832091e4fc62e6e100932a1f955f9d7cf /lib/sqlalchemy/testing/plugin/pytestplugin.py
parent4b3a68e91c73ae84a3719d6933dc991ec2453d5b (diff)
downloadsqlalchemy-993e6449e3f5f3532f6f5426b824718435ce6c6d.tar.gz
Dont raise on pytest deprecation warnings
py.test 5.4.0 emits deprecation warnings for pytest.Class. make sure we don't raise for these, and log the code that will be used for 5.4.0 when we bump requirements. Fixes: #5201 Change-Id: I83e0402c4a6b2365a63b58d052c6989df3a37328
Diffstat (limited to 'lib/sqlalchemy/testing/plugin/pytestplugin.py')
-rw-r--r--lib/sqlalchemy/testing/plugin/pytestplugin.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/sqlalchemy/testing/plugin/pytestplugin.py b/lib/sqlalchemy/testing/plugin/pytestplugin.py
index c39f9f32e..f2e7d706f 100644
--- a/lib/sqlalchemy/testing/plugin/pytestplugin.py
+++ b/lib/sqlalchemy/testing/plugin/pytestplugin.py
@@ -160,6 +160,11 @@ def pytest_collection_modifyitems(session, config, items):
if sub_cls is not test_class.cls:
per_cls_dict = rebuilt_items[test_class.cls]
+ # in pytest 5.4.0
+ # for inst in pytest.Class.from_parent(
+ # test_class.parent.parent, name=sub_cls.__name__
+ # ).collect():
+
for inst in pytest.Class(
sub_cls.__name__, parent=test_class.parent.parent
).collect():
@@ -188,6 +193,14 @@ def pytest_collection_modifyitems(session, config, items):
def pytest_pycollect_makeitem(collector, name, obj):
if inspect.isclass(obj) and plugin_base.want_class(name, obj):
+
+ # in pytest 5.4.0
+ # return [
+ # pytest.Class.from_parent(collector,
+ # name=parametrize_cls.__name__)
+ # for parametrize_cls in _parametrize_cls(collector.module, obj)
+ # ]
+
return [
pytest.Class(parametrize_cls.__name__, parent=collector)
for parametrize_cls in _parametrize_cls(collector.module, obj)