'Install the PEP 302 import hook if using assertion re-writing.
Needs to parse the --assert=<mode> option from the commandline
and find all the installed plugins to mark them for re-writing
by the importhook.'

def _consider_importhook(self, args):

    (ns, unknown_args) = self._parser.parse_known_and_unknown_args(args)
    mode = ns.assertmode
    if (mode == 'rewrite'):
        try:
            hook = _pytest.assertion.install_importhook(self)
        except SystemError:
            mode = 'plain'
        else:
            self._mark_plugins_for_rewrite(hook)
    self._warn_about_missing_assertion(mode)
