void () { final String fileName = "reference_tests.py"; runPythonTest(new PyProcessWithConsoleTestTask<PyTestTestProcessRunner>("/testRunner/env/unit", SdkCreationType.EMPTY_SDK) { @NotNull @Override protected PyTestTestProcessRunner createProcessRunner() { return new PyTestTestProcessRunner(fileName, 0); } @Override protected void checkTestResults(@NotNull final PyTestTestProcessRunner runner, @NotNull final String stdout, @NotNull final String stderr, @NotNull final String all, int exitCode) { final List<String> fileNames = runner.getHighlightedStringsInConsole().second; assertThat("No lines highlighted", fileNames, not(Matchers.empty())); // PyTest highlights file:line_number assertTrue("Assert fail not marked", fileNames.contains("reference_tests.py:7")); assertTrue("Failed test not marked", fileNames.contains("reference_tests.py:12")); assertTrue("Failed test not marked", fileNames.contains("reference_tests.py")); } }); }