diff --git a/plugins/org.python.pydev.core/tests/org/python/pydev/core/TestDependent.java b/plugins/org.python.pydev.core/tests/org/python/pydev/core/TestDependent.java index 3e4c948374..6a6d9e47f4 100644 --- a/plugins/org.python.pydev.core/tests/org/python/pydev/core/TestDependent.java +++ b/plugins/org.python.pydev.core/tests/org/python/pydev/core/TestDependent.java @@ -177,7 +177,21 @@ public static boolean isUnix() { } if (TEST_PYDEV_BASE_LOC == null) { - System.err.println("TEST_PYDEV_BASE_LOC variable MUST be set in " + propertiesFile + " to run tests."); + File file = new File(TestDependent.class.getProtectionDomain().getCodeSource().getLocation().getPath()); + + // File is something as Pydev/plugins/org.python.pydev.core + // We want something as: Pydev/plugins/ + file = file.getParentFile(); + if (new File(file, "org.python.pydev.core").exists()) { + TEST_PYDEV_BASE_LOC = file.toString().replace("\\", "/"); + if (!TEST_PYDEV_BASE_LOC.endsWith("/")) { + TEST_PYDEV_BASE_LOC += '/'; + } + } else { + System.err.println( + "TEST_PYDEV_BASE_LOC variable MUST be set in " + propertiesFile + " to run tests."); + } + } else if (!new File(TEST_PYDEV_BASE_LOC).exists()) { System.err.println("TEST_PYDEV_BASE_LOC variable points to path that does NOT exist: " + TEST_PYDEV_BASE_LOC); diff --git a/plugins/org.python.pydev.core/tests/org/python/pydev/core/TestDependent.mac.properties b/plugins/org.python.pydev.core/tests/org/python/pydev/core/TestDependent.mac.properties new file mode 100644 index 0000000000..80dc2f21a0 --- /dev/null +++ b/plugins/org.python.pydev.core/tests/org/python/pydev/core/TestDependent.mac.properties @@ -0,0 +1,3 @@ + +PYTHON_INSTALL = /Users/fabioz/Desktop/conda/miniconda3/envs/py311/ +PYTHON_EXE = /Users/fabioz/Desktop/conda/miniconda3/envs/py311/bin/python