PyCharm: remove convert-to-conda test because this code was already removed.

All "vanilla" flavours were converted to conda long ago.

GitOrigin-RevId: 1c87c04a3def2d1c3c6d330b6d4be2c429c78854
This commit is contained in:
Ilya.Kazakevich
2024-08-01 20:31:25 +02:00
committed by intellij-monorepo-bot
parent 8b8d3ec168
commit 84f000f4a9

View File

@@ -6,11 +6,8 @@ import com.intellij.execution.processTools.getBareExecutionResult
import com.intellij.execution.target.local.LocalTargetEnvironment
import com.intellij.execution.target.local.LocalTargetEnvironmentRequest
import com.intellij.execution.target.value.TargetEnvironmentFunction
import com.intellij.openapi.application.writeAction
import com.intellij.openapi.diagnostic.Logger
import com.intellij.openapi.projectRoots.ProjectJdkTable
import com.intellij.openapi.projectRoots.Sdk
import com.intellij.openapi.projectRoots.impl.SdkBridge
import com.intellij.openapi.util.SystemInfoRt
import com.intellij.openapi.util.registry.Registry
import com.intellij.testFramework.ProjectRule
@@ -19,7 +16,6 @@ import com.jetbrains.getPythonVersion
import com.jetbrains.python.psi.LanguageLevel
import com.jetbrains.python.run.PythonScriptExecution
import com.jetbrains.python.run.buildTargetedCommandLine
import com.jetbrains.python.sdk.PythonSdkType
import com.jetbrains.python.sdk.add.target.conda.createCondaSdkAlongWithNewEnv
import com.jetbrains.python.sdk.add.target.conda.createCondaSdkFromExistingEnv
import com.jetbrains.python.sdk.flavors.conda.*
@@ -27,7 +23,6 @@ import com.jetbrains.python.sdk.getOrCreateAdditionalData
import kotlinx.coroutines.test.runTest
import org.hamcrest.MatcherAssert
import org.hamcrest.Matchers
import org.jdom.Element
import org.junit.*
import org.junit.rules.RuleChain
import org.junit.rules.TemporaryFolder
@@ -130,30 +125,6 @@ internal class PyCondaSdkTest {
}
}
@Test
fun testConvertToConda() = runTest {
System.setProperty("NO_FS_ROOTS_ACCESS_CHECK", "true")
val env = PyCondaEnv.getEnvs(condaRule.commandExecutor, condaRule.condaPathOnTarget).getOrThrow().first()
val condaSdk = condaRule.condaCommand.createCondaSdkFromExistingEnv(env.envIdentity, emptyList(), projectRule.project)
val pythonPath = condaSdk.homePath
val legacyPythonSdk = ProjectJdkTable.getInstance().createSdk("my conda", PythonSdkType.getInstance())
legacyPythonSdk.sdkModificator.let {
it.homePath = pythonPath
writeAction {
it.commitChanges()
}
}
val element = Element("root")
(legacyPythonSdk as? SdkBridge)?.writeExternal(element)
(legacyPythonSdk as? SdkBridge)?.readExternal(element)
val fixedAdditionalData = legacyPythonSdk.getOrCreateAdditionalData()
Assert.assertEquals("Wrong flavor", CondaEnvSdkFlavor.getInstance(), fixedAdditionalData.flavor) // Ensure correct identity created
((fixedAdditionalData.flavorAndData.data as PyCondaFlavorData).env.envIdentity as PyCondaEnvIdentity.UnnamedEnv)
Assert.assertEquals("", pythonPath, legacyPythonSdk.getPythonBinaryPath(projectRule.project).getOrThrow())
}
@Test
fun createSdkByFile() = runTest(timeout = 50.seconds) {
val newCondaInfo = NewCondaEnvRequest.LocalEnvByLocalEnvironmentFile(yamlRule.yamlFilePath)
@@ -179,7 +150,7 @@ internal class PyCondaSdkTest {
private suspend fun ensureHomePathCorrect(sdk: Sdk) {
val homePath = Path.of(sdk.homePath!!)
Assert.assertEquals("Wrong home path", homePath,Path.of(sdk.getPythonBinaryPath(projectRule.project).getOrThrow()))
Assert.assertEquals("Wrong home path", homePath, Path.of(sdk.getPythonBinaryPath(projectRule.project).getOrThrow()))
}
}