void () { runPythonTest( new PyUnitTestLikeProcessWithConsoleTestTask<>("/testRunner/env/unit", "test_with_skips_and_errors.py", config -> { // Second rerun should lead to exception return createTestRunner(config.increaseRerunCount(2)); }) { @Override protected void exceptionThrown(@NotNull Throwable e, @NotNull PyUnitTestProcessRunner runner) { assertEquals("Wrong type of exception", e.getClass(), ExecutionException.class); assertTrue("Exception should be thrown on the first or second rerun", runner.getCurrentRerunStep() > 0); assertEquals(e.getMessage(), PyBundle.message("runcfg.tests.cant_rerun")); } @Override protected void checkTestResults(@NotNull final PyUnitTestProcessRunner runner, @NotNull final String stdout, @NotNull final String stderr, @NotNull final String all, int exitCode) { assert runner.getFailedTestsCount() > 0 : "We need failed tests to test broken rerun"; assertEquals("No exception thrown or rerun, but it should", 0, runner.getCurrentRerunStep()); EdtTestUtil.runInEdtAndWait(() -> { // Delete files, so next rerun should lead to exception deleteAllTestFiles(myFixture); }); } }); }