def __init__(cls, name, bases, classdict): type.__init__(cls, name, bases, classdict) # Don't try to patch if we're the base class if not name.startswith('Test'): return if 'domain' not in classdict: #warnings.warn("no domain attribute found in %s" % name, stacklevel=2) pass else: monkeypatch(cls, 'test_crud', 'crud')
def __init__(cls, name, bases, classdict): type.__init__(cls, name, bases, classdict) # Don't try to patch if we're the base class if not name.startswith("Test"): return if "domain" not in classdict: # warnings.warn("no domain attribute found in %s" % name, stacklevel=2) pass else: monkeypatch(cls, "test_crud", "crud")
def __init__(mcs, name, bases, classdict): type.__init__(mcs, name, bases, classdict) # Don't try to patch the base class if not name.startswith("Test"): return if "table" not in classdict: warnings.warn("no table attribute found in %s" % name, stacklevel=2) else: monkeypatch(mcs, "test_insert", "insert") for k in ["not_nullable", "unique"]: if k + "s" in classdict: monkeypatch(mcs, "test_" + k, k)
def __init__(mcs, name, bases, classdict): type.__init__(mcs, name, bases, classdict) # Don't try to patch the base class if not name.startswith('Test'): return if 'table' not in classdict: warnings.warn("no table attribute found in %s" % name, stacklevel=2) else: monkeypatch(mcs, 'test_insert', 'insert') for k in ['not_nullable', 'unique']: if k + 's' in classdict: monkeypatch(mcs, 'test_' + k, k)