示例#1
0
文件: backend.py 项目: hvy/chainer
def inject_backend_tests(method_names, params):
    if not (method_names is None or isinstance(method_names, list)):
        raise TypeError('method_names must be either None or a list.')
    if not isinstance(params, list):
        raise TypeError('params must be a list of dicts.')
    if not all(isinstance(d, dict) for d in params):
        raise TypeError('params must be a list of dicts.')

    return _bundle.make_decorator(
        lambda base: _test_case_generator(base, method_names, params))
示例#2
0
def inject_backend_tests(method_names, params):
    if not (method_names is None or isinstance(method_names, list)):
        raise TypeError('method_names must be either None or a list.')
    if not isinstance(params, list):
        raise TypeError('params must be a list of dicts.')
    if not all(isinstance(d, dict) for d in params):
        raise TypeError('params must be a list of dicts.')

    return _bundle.make_decorator(
        lambda base: _test_case_generator(base, method_names, params))
示例#3
0
def parameterize(*params):
    # TODO(niboshi): Add documentation
    return _bundle.make_decorator(
        lambda base: _parameterize_test_case_generator(base, params))
示例#4
0
def parameterize(*params):
    return _bundle.make_decorator(
        lambda base: _parameterize_test_case_generator(base, params))
示例#5
0
def parameterize(*params):
    # TODO(niboshi): Add documentation
    return _bundle.make_decorator(
        lambda base: _parameterize_test_case_generator(base, params))