void () { runPythonTest(new PyProcessWithConsoleTestTask<PyTestTestProcessRunner>("/testRunner/env/pytest/", SdkCreationType.EMPTY_SDK) { @NotNull @Override protected PyTestTestProcessRunner createProcessRunner() { return new PyTestTestProcessRunner("", 0) { @Override protected void configurationCreatedAndWillLaunch(@NotNull final PyTestConfiguration configuration) throws IOException { super.configurationCreatedAndWillLaunch(configuration); configuration.setWorkingDirectory(null); final VirtualFile fullFilePath = myFixture.getTempDirFixture().getFile("dir_test.py"); assert fullFilePath != null : String.format("No dir_test.py in %s", myFixture.getTempDirFixture().getTempDirPath()); configuration.getTarget().setTarget(fullFilePath.getPath()); configuration.getTarget().setTargetType(PyRunTargetVariant.PATH); } }; } @Override protected void checkTestResults(@NotNull final PyTestTestProcessRunner runner, @NotNull final String stdout, @NotNull final String stderr, @NotNull final String all, int exitCode) { final String projectDir = myFixture.getTempDirFixture().getTempDirPath(); assertThat("No directory found in output", runner.getConsole().getText(), containsString(String.format("Directory %s", PathUtil.toSystemDependentName(projectDir)))); } }); }