From: Mike Bayer Date: Sun, 27 Sep 2020 15:31:18 +0000 (-0400) Subject: Support pytest 6.x X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=46db1968b8dc00acd1232c3dd8b87b857a76d176;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Support pytest 6.x pytest has removed support for pytest.Class().collect() and we need to use from_parent. Change-Id: Ia5fed9b22e76c99f71489283acee207f996f52a4 --- diff --git a/lib/sqlalchemy/testing/plugin/pytestplugin.py b/lib/sqlalchemy/testing/plugin/pytestplugin.py index c15a5c0620..b8c22c34c2 100644 --- a/lib/sqlalchemy/testing/plugin/pytestplugin.py +++ b/lib/sqlalchemy/testing/plugin/pytestplugin.py @@ -143,8 +143,9 @@ def pytest_collection_modifyitems(session, config, items): if sub_cls is not test_class.cls: list_ = rebuilt_items[test_class.cls] - for inst in pytest.Class( - sub_cls.__name__, parent=test_class.parent.parent + ctor = getattr(pytest.Class, "from_parent", pytest.Class) + for inst in ctor( + name=sub_cls.__name__, parent=test_class.parent.parent ).collect(): list_.extend(inst.collect())