void (boolean useCustomMode) { runPythonTest(new PyProcessWithConsoleTestTask<PyTestTestProcessRunner>("/testRunner/env/pytest/testNameBeforeTestStarted", SdkCreationType.EMPTY_SDK) { @NotNull @Override protected PyTestTestProcessRunner createProcessRunner() { return new PyTestTestProcessRunner("test_test.py", 0) { @Override protected void configurationCreatedAndWillLaunch(@NotNull final PyTestConfiguration configuration) throws IOException { super.configurationCreatedAndWillLaunch(configuration); configuration.setKeywords("asdasdasd"); if (useCustomMode) { configuration.getTarget().setTargetType(PyRunTargetVariant.CUSTOM); } } }; } @Override protected void checkTestResults(@NotNull final PyTestTestProcessRunner runner, @NotNull final String stdout, @NotNull final String stderr, @NotNull final String all, final int exitCode) { if (useCustomMode) { assertEquals("Wrong test launched", """ Test tree: [root](+) .test_test(+) ..SampleTest1(+) ...test_sample_1(+) ...test_sample_2(+) ...test_sample_3(+) ...test_sample_4(+) ..SampleTest2(+) ...test_sample_5(+) ...test_sample_6(+) ...test_sample_7(+) ...test_sample_8(+) """, runner.getFormattedTestTree()); runner.getFormattedTestTree(); } else { assertEquals("Wrong message for empty suite", PyBundle.message("runcfg.tests.empty_suite"), runner.getTestProxy().getPresentation()); assertEquals("Wrong empty suite tree", """ Test tree: [root](-) """, runner.getFormattedTestTree()); } } }); }