Python sqla_plugin_base.want_class() Examples

The following are 14 code examples of sqla_plugin_base.want_class(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module sqla_plugin_base , or try the search function .
Example #1
Source File: noseplugin.py    From jbox with MIT License 5 votes vote down vote up
def wantClass(self, cls):
        return plugin_base.want_class(cls) 
Example #2
Source File: pytestplugin.py    From jbox with MIT License 5 votes vote down vote up
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 [] 
Example #3
Source File: pytestplugin.py    From alembic with MIT License 5 votes vote down vote up
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 [] 
Example #4
Source File: noseplugin.py    From Fluid-Designer with GNU General Public License v3.0 5 votes vote down vote up
def wantClass(self, cls):
        return plugin_base.want_class(cls) 
Example #5
Source File: pytestplugin.py    From Fluid-Designer with GNU General Public License v3.0 5 votes vote down vote up
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 [] 
Example #6
Source File: noseplugin.py    From planespotter with MIT License 5 votes vote down vote up
def wantClass(self, cls):
        return plugin_base.want_class(cls) 
Example #7
Source File: pytestplugin.py    From planespotter with MIT License 5 votes vote down vote up
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 [] 
Example #8
Source File: noseplugin.py    From pyRevit with GNU General Public License v3.0 5 votes vote down vote up
def wantClass(self, cls):
        return plugin_base.want_class(cls) 
Example #9
Source File: pytestplugin.py    From pyRevit with GNU General Public License v3.0 5 votes vote down vote up
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 [] 
Example #10
Source File: pytestplugin.py    From sqlalchemy with MIT License 5 votes vote down vote up
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 [] 
Example #11
Source File: noseplugin.py    From jarvis with GNU General Public License v2.0 5 votes vote down vote up
def wantClass(self, cls):
        return plugin_base.want_class(cls) 
Example #12
Source File: pytestplugin.py    From jarvis with GNU General Public License v2.0 5 votes vote down vote up
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 [] 
Example #13
Source File: noseplugin.py    From android_universal with MIT License 5 votes vote down vote up
def wantClass(self, cls):
        return plugin_base.want_class(cls) 
Example #14
Source File: pytestplugin.py    From android_universal with MIT License 5 votes vote down vote up
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 []