{
PySystemState systemState = new PySystemState();
if (xmlReportFile != null)
{
systemState.argv.append(new PyString("--xml"));
systemState.argv.append(new PyString(xmlReportFile));
}
if(ignoreFile == null)
{
ignoreFile = System.getProperty(IGNORE_FILE_SYSTEM_PROPERTY);
}
if(ignoreFile != null)
{
systemState.argv.append(new PyString("-I"));
systemState.argv.append(new PyString(ignoreFile));
}
String testPattern = System.getProperty(TEST_PATTERN_SYSTEM_PROPERTY);
if(testPattern != null)
{
systemState.argv.append(new PyString(testPattern));
}
if(Boolean.getBoolean(ALWAYS_COLORIZE_SYSTEM_PROPERTY))
{
systemState.argv.append(new PyString("--always-colorize"));
}
PythonInterpreter interp = new PythonInterpreter(null, systemState);
return interp;
}