void () { runPythonTest(new PyUnitTestProcessWithConsoleTestTask("testRunner/env/unit/package_in_folder", "tests") { @NotNull @Override protected PyUnitTestProcessRunner createProcessRunner() { // Full pass is required because it is folder return new PyUnitTestProcessRunner(toFullPath(getMyScriptName()), 2) { @Override protected void configurationCreatedAndWillLaunch(@NotNull PyUnitTestConfiguration configuration) throws IOException { super.configurationCreatedAndWillLaunch(configuration); configuration.setWorkingDirectory(null); //Unset working dir: should be set to tests automatically } }; } @Override protected void checkTestResults(@NotNull PyUnitTestProcessRunner runner, @NotNull String stdout, @NotNull String stderr, @NotNull String all, int exitCode) { if (runner.getCurrentRerunStep() == 0) { assertEquals(runner.getFormattedTestTree(), 2, runner.getAllTestsCount()); } else { assertEquals(runner.getFormattedTestTree(), 1, runner.getAllTestsCount()); } } }); }