void () { runPythonTest(new PyProcessWithConsoleTestTask<PyTestTestProcessRunner>("/testRunner/env/pytest", SdkCreationType.EMPTY_SDK) { @NotNull @Override protected PyTestTestProcessRunner createProcessRunner() { return new PyTestTestProcessRunner("test1.py", 0); } @Override protected void checkTestResults(@NotNull final PyTestTestProcessRunner runner, @NotNull final String stdout, @NotNull final String stderr, @NotNull final String all, int exitCode) { assertEquals(3, runner.getAllTestsCount()); assertEquals(3, runner.getPassedTestsCount()); runner.assertAllTestsPassed(); // This test has "sleep(1)", so duration should be >=1000 final AbstractTestProxy testForOneSecond = runner.findTestByName("testOne"); assertThat("Wrong duration", testForOneSecond.getDuration(), Matchers.greaterThanOrEqualTo(1000L)); } }); }