Disposable (CodeInsightTestFixture fixture) { final String path = fixture.getTestDataPath() + "/pyi/pyiStubs"; final VirtualFile file = StandardFileSystems.local().refreshAndFindFileByPath(path); assertNotNull(file); file.refresh(false, true); ModuleRootModificationUtil.addContentRoot(fixture.getModule(), path); return () -> ModuleRootModificationUtil.updateModel(fixture.getModule(), model -> { for (ContentEntry entry : model.getContentEntries()) { if (file.equals(entry.getFile())) { model.removeContentEntry(entry); } } }); }