void () { runPythonTest(new CreateConfigurationTestTask<>(getFrameworkId(), PyTestConfiguration.class) { private static final String FOLDER_NAME = "test"; @Override public void runTestOn(@NotNull String sdkHome, @Nullable Sdk existingSdk) throws InvalidSdkException { markFolderAsTestRoot(FOLDER_NAME); super.runTestOn(sdkHome, existingSdk); } @Override protected void checkConfiguration(@NotNull final PyTestConfiguration configuration, @NotNull final PsiElement elementToRightClickOn) { assertEquals("Wrong target created", "test_test.TestFoo", configuration.getTarget().getTarget()); } @NotNull @Override protected List<PsiElement> getPsiElementsToRightClickOn() { var file = (PyFile)myFixture.configureByFile(FOLDER_NAME + "/test_test.py"); var clazz = file.findTopLevelClass("TestFoo"); assert clazz != null : "No test found"; return Collections.singletonList(clazz); } }); }