void () { runPythonTest(new PyProcessWithConsoleTestTask<PyTestTestProcessRunner>("/testRunner/env/pytest/diff_unit", SdkCreationType.EMPTY_SDK) { @NotNull @Override protected PyTestTestProcessRunner createProcessRunner() { return new PyTestTestProcessRunner("test_diff.py", 1); } @Override protected void checkTestResults(@NotNull final PyTestTestProcessRunner runner, @NotNull final String stdout, @NotNull final String stderr, @NotNull final String all, int exitCode) { Iterable<Matcher<? super String>> expectedConsoleText = ContainerUtil.map(ImmutableList.of("Expected :'A'", "Actual :'B'", "<Click to see difference>"), Matchers::containsString); var consoleText = runner.getAllConsoleText(); assertThat("No diff", consoleText, allOf(expectedConsoleText)); assertThat("Wrong line", consoleText, containsString("test_diff.py:7: AssertionError")); } }); }