From 815db759e10703df6597144236eaef4c3f4b0935 Mon Sep 17 00:00:00 2001 From: "Ilya.Kazakevich" Date: Wed, 12 Aug 2026 19:51:06 +0200 Subject: [PATCH] tests [python]: Fix `NoCondaAndVenAsSystemPythonsTest`. It is perfectly valid to have conda base python injected as `PythonBinaryPath` . However, it should not be system python (cherry picked from commit 40f81a8897927c00eb49d2ed94ec93a422f58cdf) IJ-CR-220955 GitOrigin-RevId: cf75731a694dd693fb2ec41abf432ad9065b3b24 --- .../junit5Tests/framework/conda/PyEnvTestCaseWithConda.kt | 3 +++ .../python/junit5Tests/framework/env/PythonBinaryPath.kt | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/python/python-test-env/junit5/src/com/intellij/python/community/junit5Tests/framework/conda/PyEnvTestCaseWithConda.kt b/python/python-test-env/junit5/src/com/intellij/python/community/junit5Tests/framework/conda/PyEnvTestCaseWithConda.kt index 5414c57a6124..6f6cfe3fda9e 100644 --- a/python/python-test-env/junit5/src/com/intellij/python/community/junit5Tests/framework/conda/PyEnvTestCaseWithConda.kt +++ b/python/python-test-env/junit5/src/com/intellij/python/community/junit5Tests/framework/conda/PyEnvTestCaseWithConda.kt @@ -20,6 +20,9 @@ class PyEnvTestExample { @Test fun testSdk(@PythonSdk sdk: Sdk) { ... } + + @Test // This is a base conda path! + fun testSdk(@PythonBinaryPath pythonExe: PythonBinary) { ... } } * ``` */ diff --git a/python/python-test-env/junit5/src/com/intellij/python/junit5Tests/framework/env/PythonBinaryPath.kt b/python/python-test-env/junit5/src/com/intellij/python/junit5Tests/framework/env/PythonBinaryPath.kt index 8bd236258520..575d44addc70 100644 --- a/python/python-test-env/junit5/src/com/intellij/python/junit5Tests/framework/env/PythonBinaryPath.kt +++ b/python/python-test-env/junit5/src/com/intellij/python/junit5Tests/framework/env/PythonBinaryPath.kt @@ -1,6 +1,8 @@ // Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.python.junit5Tests.framework.env +import com.intellij.python.community.junit5Tests.framework.conda.PyEnvTestCaseWithConda + /** * Mark [java.nio.file.Path] test parameter to get first python binary for env test. * @@ -9,6 +11,8 @@ package com.intellij.python.junit5Tests.framework.env * @Test * fun checkPythonPath(@PythonSdkPath path: PythonBinary) // Path is python.exe for example * ``` + * + * When used with [PyEnvTestCaseWithConda], ponts to conda base path. */ @Target(AnnotationTarget.VALUE_PARAMETER)