mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Python tests: Add pythons to the list of allowed roots.
In tests, we check that no code access files outside so-called roots. Roots are usually project roots, but we might need to access files in python installation dirs (to access `black.exe`, `poetry.exe` and so on) We already fixed it for JUnit5 tests. We now fix it for the legacy `PyEnvTestCase` See `VfsRootAccess`. GitOrigin-RevId: 494e60d3d07b9d14b4001b7f37f4f5188d63c994
This commit is contained in:
committed by
intellij-monorepo-bot
parent
30b1a110eb
commit
ee348c2a40
+7
-2
@@ -5,6 +5,8 @@ import com.intellij.openapi.Disposable;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.vfs.VfsUtil;
|
||||
import com.intellij.openapi.vfs.newvfs.impl.VfsRootAccess;
|
||||
import com.intellij.testFramework.UsefulTestCase;
|
||||
import com.intellij.util.ArrayUtil;
|
||||
import com.intellij.util.ArrayUtilRt;
|
||||
@@ -236,8 +238,11 @@ public abstract class PyEnvTestCase {
|
||||
* @return list of pythons to run tests against
|
||||
*/
|
||||
@NotNull
|
||||
protected List<String> getPythonRoots() {
|
||||
return getDefaultPythonRoots();
|
||||
protected List<@NotNull String> getPythonRoots() {
|
||||
var roots = getDefaultPythonRoots();
|
||||
// It is ok to access these pythons
|
||||
VfsRootAccess.allowRootAccess(myDisposable, ArrayUtil.toStringArray(roots));
|
||||
return roots;
|
||||
}
|
||||
|
||||
private final Disposable myDisposable = Disposer.newDisposable();
|
||||
|
||||
Reference in New Issue
Block a user