void (String namespace) { myFixture.copyDirectoryToProject(namespace, ""); runWithSourceRoots(Lists.newArrayList(myFixture.findFileInTempDir("root1"), myFixture.findFileInTempDir("root2")), () -> { final PsiFile psiFile = myFixture.configureByFile("root1/pkg/a.py"); final PsiReference ref = PyResolveTestCase.findReferenceByMarker(psiFile); assertInstanceOf(ref, PsiPolyVariantReference.class); final List<PsiElement> elements = PyUtil.multiResolveTopPriority((PsiPolyVariantReference)ref); assertEquals(1, elements.size()); PsiFile root1 = myFixture.getPsiManager().findFile(myFixture.findFileInTempDir("root1/pkg/__init__.py")); PsiFile root2 = myFixture.getPsiManager().findFile(myFixture.findFileInTempDir("root2/pkg/__init__.py")); assertNotParsed(root1); assertNotParsed(root2); }); }