本文整理匯總了Python中sqla_plugin_base.want_class方法的典型用法代碼示例。如果您正苦於以下問題:Python sqla_plugin_base.want_class方法的具體用法?Python sqla_plugin_base.want_class怎麽用?Python sqla_plugin_base.want_class使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類sqla_plugin_base
的用法示例。
在下文中一共展示了sqla_plugin_base.want_class方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: wantClass
# 需要導入模塊: import sqla_plugin_base [as 別名]
# 或者: from sqla_plugin_base import want_class [as 別名]
def wantClass(self, cls):
return plugin_base.want_class(cls)
示例2: pytest_pycollect_makeitem
# 需要導入模塊: import sqla_plugin_base [as 別名]
# 或者: from sqla_plugin_base import want_class [as 別名]
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 \
isinstance(collector, pytest.Instance) and \
plugin_base.want_method(collector.cls, obj):
return pytest.Function(name, parent=collector)
else:
return []
示例3: pytest_pycollect_makeitem
# 需要導入模塊: import sqla_plugin_base [as 別名]
# 或者: from sqla_plugin_base import want_class [as 別名]
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)
]
elif (
inspect.isfunction(obj)
and isinstance(collector, pytest.Instance)
and plugin_base.want_method(collector.cls, obj)
):
# None means, fall back to default logic, which includes
# method-level parametrize
return None
else:
# empty list means skip this item
return []