def register_assert_rewrite(*names):
for name in names:<EOL><INDENT>if not isinstance(name, str):<EOL><INDENT>msg = "<STR_LIT>"<EOL>raise TypeError(msg.format(repr(names)))<EOL><DEDENT><DEDENT>for hook in sys.meta_path:<EOL><INDENT>if isinstance(hook, rewrite.AssertionRewritingHook):<EOL><INDENT>importhook = hook<EOL>break<EOL><DEDENT><DEDENT>else:<EOL><INDENT>importhook = DummyRewriteHook()<EOL><DEDENT>importhook.mark_rewrite(*names)<EOL>
Register one or more module names to be rewritten on import.

    This function will make sure that this module or all modules inside
    the package will get their assert statements rewritten.
    Thus you should make sure to call this before the module is
    actually imported, usually in your __init__.py if you are a plugin
    using a package.

    :raise TypeError: if the given module names are not strings.