def runpytest_inprocess(self, *args, **kwargs):
        """ Return result of running pytest in-process, providing a similar
        interface to what self.runpytest() provides. """
        if kwargs.get("syspathinsert"):
            self.syspathinsert()
        now = time.time()
        capture = py.io.StdCapture()
        try:
            try:
                reprec = self.inline_run(*args, **kwargs)
            except SystemExit as e:
                class reprec:
                    ret = e.args[0]
            except Exception:
                traceback.print_exc()
                class reprec:
                    ret = 3
        finally:
            out, err = capture.reset()
            sys.stdout.write(out)
            sys.stderr.write(err)

        res = RunResult(reprec.ret,
                        out.split("\n"), err.split("\n"),
                        time.time()-now)
        res.reprec = reprec
        return res
dataset/ETHPy150Open pytest-dev/pytest/_pytest/pytester.py/Testdir.runpytest_inprocess/original