def register_assert_rewrite(*names):
 for name in names:
  if (not isinstance(name, str)):
   msg = 'expected module names as *args, got {0} instead'
   raise TypeError(msg.format(repr(names)))
 for hook in sys.meta_path:
  if isinstance(hook, rewrite.AssertionRewritingHook):
   importhook = hook
   break
 else:
  importhook = DummyRewriteHook()
 importhook.mark_rewrite(*names)

def register_assert_rewrite ( * names ) : for name in names : if ( not isinstance ( name , str ) ) : msg = 'expected module names as *args, got {0} instead' raise TypeError ( msg . format ( repr ( names ) ) ) for hook in sys . meta_path : if isinstance ( hook , rewrite . AssertionRewritingHook ) : importhook = hook break else : importhook = DummyRewriteHook ( ) importhook . mark_rewrite ( * names )
register one or more module names to be rewritten on import .