Sdk (@NotNull String sdkName, @NotNull String sdkPath, @NotNull SdkTypeId sdkType, @NotNull LanguageLevel level, VirtualFile @NotNull ... additionalRoots) { MultiMap<OrderRootType, VirtualFile> roots = MultiMap.create(); roots.putValues(OrderRootType.CLASSES, createRoots(sdkPath, level)); roots.putValues(OrderRootType.CLASSES, Arrays.asList(additionalRoots)); MockSdk sdk = new MockSdk( sdkName, sdkPath + "/bin/python", toVersionString(level), roots, sdkType ); // com.jetbrains.python.psi.resolve.PythonSdkPathCache.getInstance() corrupts SDK, so have to clone return sdk.clone(); }