void () { myFixture.configureByFile(RENAME_DATA_PATH + getTestName(true) + ".py"); final PyTargetExpression attr = (PyTargetExpression)myFixture.getElementAtCaret(); final GlobalSearchScope singleFileScope = GlobalSearchScope.fileScope(myFixture.getFile()); final List<PsiElement> found = new ArrayList<>(); TextOccurrencesUtil.processUsagesInStringsAndComments(attr, singleFileScope, attr.getName(), true, (psiElement, textRange) -> { found.add(psiElement); return true; }); assertEmpty(found); }