void () { myFixture.copyDirectoryToProject("manySourceRoots", ""); runWithSourceRoots(Lists.newArrayList(myFixture.findFileInTempDir("root1"), myFixture.findFileInTempDir("root2")), () -> { final PsiFile psiFile = myFixture.configureByFile("a.py"); final PsiReference ref = PyResolveTestCase.findReferenceByMarker(psiFile); assertInstanceOf(ref, PsiPolyVariantReference.class); final List<PsiElement> elements = PyUtil.multiResolveTopPriority((PsiPolyVariantReference)ref); assertEquals(1, elements.size()); final PsiElement element = elements.get(0); assertInstanceOf(element, PyFile.class); final VirtualFile file = ((PyFile)element).getVirtualFile(); assertEquals("root1", file.getParent().getName()); }); }