CommandLinePatcher () { return new CommandLinePatcher() { @Override public void patchCommandLine(GeneralCommandLine commandLine) { final ParamsGroup scriptGroup = commandLine.getParametersList().getParamsGroup(PythonCommandLineState.GROUP_SCRIPT); scriptGroup.addParameterAt(0, "--path"); scriptGroup.addParameterAt(0, PythonHelper.PYTEST.asParamString()); commandLine.getEnvironment().put("PYTEST_RUN_CONFIG", "True"); } }; }