void () { runPythonTest(new PyProcessWithConsoleTestTask<PyTestTestProcessRunner>("/testRunner/env/pytest/", SdkCreationType.EMPTY_SDK) { @NotNull @Override protected PyTestTestProcessRunner createProcessRunner() { return new PyTestTestProcessRunner("test_escape_me.py", 0); } @Override protected void checkTestResults(@NotNull final PyTestTestProcessRunner runner, @NotNull final String stdout, @NotNull final String stderr, @NotNull final String all, int exitCode) { ApplicationManager.getApplication().invokeAndWait(() -> { final String resultTree = runner.getFormattedTestTree().trim(); final String expectedTree = myFixture.configureByFile("test_escape_me.tree.txt").getText().trim(); assertEquals("Test result wrong tree", expectedTree, resultTree); }); } }); }