'Return a new pytest Config instance from given commandline args.
This invokes the pytest bootstrapping code in _pytest.config
to create a new :py:class:`_pytest.core.PluginManager` and
call the pytest_cmdline_parse hook to create new
:py:class:`_pytest.config.Config` instance.
If :py:attr:`plugins` has been populated they should be plugin
modules which will be registered with the PluginManager.'

def parseconfig(self, *args):

    args = self._ensure_basetemp(args)
    import _pytest.config
    config = _pytest.config._prepareconfig(args, self.plugins)
    self.request.addfinalizer(config._ensure_unconfigure)
    return config
