Python: decouple test-env from UsefulTestCase because it overwrites logger and breaks RD tests

GitOrigin-RevId: 00aac829d9f2e6d0e71f9cf0dd510c73519c7e85
This commit is contained in:
Ilya.Kazakevich
2025-02-19 21:27:25 +00:00
committed by intellij-monorepo-bot
parent d066a2f02d
commit 967fd16ddb
3 changed files with 5 additions and 5 deletions
@@ -10,10 +10,10 @@
<orderEntry type="library" name="kotlin-stdlib" level="project" />
<orderEntry type="module" module-name="intellij.platform.util" />
<orderEntry type="module" module-name="intellij.python.community" />
<orderEntry type="module" module-name="intellij.platform.testFramework" />
<orderEntry type="module" module-name="intellij.python.sdk" />
<orderEntry type="module" module-name="intellij.platform.execution" />
<orderEntry type="library" name="kotlin-reflect" level="project" />
<orderEntry type="module" module-name="intellij.platform.lang.impl" />
<orderEntry type="module" module-name="intellij.platform.ide.impl" />
</component>
</module>
@@ -2,13 +2,14 @@
package com.intellij.python.community.testFramework.testEnv
import com.intellij.python.community.testFramework.testEnv.PyEnvTestSettings.Companion.PATH_TO_TEST_ENV_PYTHON_INTERPRETERS
import com.intellij.testFramework.UsefulTestCase.IS_UNDER_TEAMCITY
import com.intellij.util.SystemProperties
import org.jetbrains.annotations.ApiStatus
import org.jetbrains.annotations.TestOnly
import java.io.File
private val IS_UNDER_TEAMCITY: Boolean = System.getenv("TEAMCITY_VERSION") != null
/**
* Configures env test environment using env vars and properties.
* Environment variables are also used in gradle script (setup-test-environment)
@@ -6,7 +6,7 @@ import com.intellij.openapi.projectRoots.SdkType
import com.intellij.openapi.projectRoots.impl.SdkConfigurationUtil
import com.intellij.openapi.util.Disposer
import com.intellij.openapi.vfs.newvfs.impl.VfsRootAccess
import com.intellij.testFramework.utils.vfs.refreshAndGetVirtualFile
import com.intellij.openapi.vfs.refreshAndFindVirtualFileOrDirectory
import com.jetbrains.python.PyNames
import com.jetbrains.python.PythonBinary
import java.nio.file.Path
@@ -14,9 +14,8 @@ import java.nio.file.Path
data object TypeVanillaPython3 : PythonType<PythonBinary>("python3") {
override suspend fun createSdkFor(python: PythonBinary): Sdk = createSdk(python)
// TODO: DOC
fun createSdk(python: PythonBinary): Sdk =
SdkConfigurationUtil.setupSdk(emptyArray(), python.refreshAndGetVirtualFile(),
SdkConfigurationUtil.setupSdk(emptyArray(), python.refreshAndFindVirtualFileOrDirectory()!!,
SdkType.findByName(PyNames.PYTHON_SDK_ID_NAME)!!, null, null)
// Python is directly executable