void (@NotNull final AbstractTestProxy method, @NotNull final String functionName) { final Location<?> methodLocation = method.getLocation(getProject(), GlobalSearchScope.moduleScope(myFixture.getModule())); Assert.assertNotNull("Failed to resolve method location " + method, methodLocation); final PsiElement methodPsiElement = methodLocation.getPsiElement(); Assert.assertNotNull("Failed to get PSI for method location", methodPsiElement); Assert.assertThat("Wrong test returned", methodPsiElement, Matchers.instanceOf(PyFunction.class)); Assert.assertEquals("Wrong method name", functionName, ((PsiNamedElement)methodPsiElement).getName()); }