def depends(func=None, after=None, before=None, priority=None):
if not (func is None or inspect.ismethod(func) or inspect.isfunction(func)):<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>if not (after or before or priority):<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>if func is None:<EOL><INDENT>return partial(depends, after=after, before=before, priority=priority)<EOL><DEDENT>def self_check(a, b):<EOL><INDENT>if a == b:<EOL><INDENT>raise ValueError("<STR_LIT>".format(a))<EOL><DEDENT><DEDENT>def handle_dep(conditions, _before=True):<EOL><INDENT>if conditions:<EOL><INDENT>if type(conditions) is not list:<EOL><INDENT>conditions = [conditions]<EOL><DEDENT>for cond in conditions:<EOL><INDENT>if hasattr(cond, '<STR_LIT>'):<EOL><INDENT>cond = cond.__name__<EOL><DEDENT>self_check(func.__name__, cond)<EOL>if _before:<EOL><INDENT>soft_dependencies[cond].add(func.__name__)<EOL><DEDENT>else:<EOL><INDENT>dependencies[func.__name__].add(cond)<EOL><DEDENT><DEDENT><DEDENT><DEDENT>handle_dep(before)<EOL>handle_dep(after, False)<EOL>if priority:<EOL><INDENT>priorities[func.__name__] = priority<EOL><DEDENT>@wraps(func)<EOL>def inner(*args, **kwargs):<EOL><INDENT>return func(*args, **kwargs)<EOL><DEDENT>return inner<EOL>
Decorator to specify test dependencies

    :param after: The test needs to run after this/these tests. String or list of strings.
    :param before: The test needs to run before this/these tests. String or list of strings.