void () { runPythonTest(new PyUnitTestProcessWithConsoleTestTask("testRunner/env/unit/patternRerun", ".") { @NotNull @Override protected PyUnitTestProcessRunner createProcessRunner() { // Full pass is required because it is folder return new PyUnitTestProcessRunner(toFullPath(getMyScriptName()), 2) { @Override protected void configurationCreatedAndWillLaunch(@NotNull final PyUnitTestConfiguration configuration) throws IOException { super.configurationCreatedAndWillLaunch(configuration); configuration.setPattern("test*"); } }; } @Override protected void checkTestResults(@NotNull final PyUnitTestProcessRunner runner, @NotNull final String stdout, @NotNull final String stderr, @NotNull final String all, int exitCode) { if (runner.getCurrentRerunStep() == 0) { assertEquals(stderr, 2, runner.getAllTestsCount()); } else { assertEquals(stderr, 1, runner.getAllTestsCount()); } } }); }