void () { runPythonTest(new PyUnitTestProcessWithConsoleTestTask("testRunner/env/unit/testInInit", "") { @NotNull @Override protected PyUnitTestProcessRunner createProcessRunner() { return new PyUnitTestProcessRunner("", 0) { @Override protected void configurationCreatedAndWillLaunch(@NotNull final PyUnitTestConfiguration configuration) throws IOException { super.configurationCreatedAndWillLaunch(configuration); configuration.getTarget().setTargetType(PyRunTargetVariant.PYTHON); configuration.getTarget().setTarget("mymodule.ExampleModuleTestCase"); } }; } @Override protected void checkTestResults(@NotNull final PyUnitTestProcessRunner runner, @NotNull final String stdout, @NotNull final String stderr, @NotNull final String all, int exitCode) { assertEquals("wrong test launched", """ Test tree: [root](+) .mymodule(+) ..ExampleModuleTestCase(+) ...test1(+) ...test2(+) """, runner.getFormattedTestTree()); assertEquals("wrong exit code", 0, exitCode); } }); }