void () { runPythonTest(new PyProcessWithConsoleTestTask<PyDocTestProcessRunner>("/testRunner/env/doc", SdkCreationType.EMPTY_SDK) { @NotNull @Override protected PyDocTestProcessRunner createProcessRunner() { return new PyDocTestProcessRunner("subfolder", 0) { @Override protected void configurationCreatedAndWillLaunch(@NotNull PythonDocTestRunConfiguration configuration) throws IOException { super.configurationCreatedAndWillLaunch(configuration); configuration.setTestType(AbstractPythonLegacyTestRunConfiguration.TestType.TEST_FOLDER); configuration.setPattern("ABC123"); configuration.usePattern(false); } }; } @Override protected void checkTestResults(@NotNull final PyDocTestProcessRunner runner, @NotNull final String stdout, @NotNull final String stderr, @NotNull final String all, int exitCode) { Assert.assertThat("Pattern used while it should not", all, Matchers.not(Matchers.containsString("ABC123"))); } }); }