PY-88280 fix PyVirtualEnvTerminalCustomizerTest to use .venv subdirectory

The test was looking for the Python binary directly in the temp
directory instead of the `.venv` subdirectory where the virtual
environment is actually created. Also sort imports alphabetically.


(cherry picked from commit 4fba4755f3ee51e866da299e538a53a87c6a68d5)

IJ-MR-196794

GitOrigin-RevId: 8f32934772fbf81952e16234354b1f34dd06c9e6
This commit is contained in:
Vitaly Legchilkin
2026-03-18 19:22:00 +00:00
committed by intellij-monorepo-bot
parent e88b2c7509
commit 5ba17c3874
@@ -15,7 +15,6 @@ import com.intellij.platform.eel.provider.utils.readWholeText
import com.intellij.platform.eel.provider.utils.sendWholeText
import com.intellij.platform.eel.spawnProcess
import com.intellij.python.community.junit5Tests.framework.conda.CondaEnv
import com.jetbrains.python.getOrThrow
import com.intellij.python.community.junit5Tests.framework.conda.PyEnvTestCaseWithConda
import com.intellij.python.community.junit5Tests.framework.conda.createCondaEnv
import com.intellij.python.junit5Tests.framework.env.pySdkFixture
@@ -26,6 +25,7 @@ import com.intellij.testFramework.common.timeoutRunBlocking
import com.intellij.testFramework.junit5.fixture.moduleFixture
import com.intellij.testFramework.junit5.fixture.projectFixture
import com.intellij.testFramework.junit5.fixture.tempPathFixture
import com.jetbrains.python.getOrThrow
import com.jetbrains.python.sdk.flavors.conda.PyCondaEnv
import com.jetbrains.python.sdk.persist
import com.jetbrains.python.sdk.pythonSdk
@@ -130,8 +130,9 @@ class PyVirtualEnvTerminalCustomizerTest {
Pair(Path(sdk.homePath!!), envDir.toRealPath().pathString)
}
else {
val venv = VirtualEnvReader().findPythonInPythonRoot(tempDirFixture.get())!!
Pair(venv, tempDirFixture.get().name)
val venvDir = tempDirFixture.get().resolve(".venv")
val venv = VirtualEnvReader().findPythonInPythonRoot(venvDir)!!
Pair(venv, venvDir.name)
}
// binary might be like ~8.3, we need to expand it as venv might report both