void () { runPythonTest(new PyProcessWithConsoleTestTask<PyTestTestProcessRunner>("/testRunner/env/pytest/failTest", SdkCreationType.EMPTY_SDK) { @NotNull @Override protected PyTestTestProcessRunner createProcessRunner() { return new PyTestTestProcessRunner(".", 0); } @Override protected void checkTestResults(@NotNull PyTestTestProcessRunner runner, @NotNull String stdout, @NotNull String stderr, @NotNull String all, int exitCode) { assertThat("Import error is not marked as error", runner.getFailedTestsCount(), Matchers.greaterThanOrEqualTo(1)); } }); }