From f348f0ecb15bbb19ddc1aaeb5340475539f58d41 Mon Sep 17 00:00:00 2001 From: Egor Eliseev Date: Tue, 18 Mar 2025 15:15:00 +0000 Subject: [PATCH] [python] Add the ability to set a Python version for PyCharm Debugger Test Merge-request: IJ-MR-157952 Merged-by: Egor Eliseev GitOrigin-RevId: 92e35a21b76cc6fc29c5cf1682f3f357117f7178 --- .../testFramework/testEnv/PyEnvTestSettings.kt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/python/setup-test-environment/src/com/intellij/python/community/testFramework/testEnv/PyEnvTestSettings.kt b/python/setup-test-environment/src/com/intellij/python/community/testFramework/testEnv/PyEnvTestSettings.kt index ad12e7d9da36..41c9cd919448 100644 --- a/python/setup-test-environment/src/com/intellij/python/community/testFramework/testEnv/PyEnvTestSettings.kt +++ b/python/setup-test-environment/src/com/intellij/python/community/testFramework/testEnv/PyEnvTestSettings.kt @@ -33,10 +33,13 @@ data class PyEnvTestSettings( @TestOnly @get:JvmName("getPythons") internal val pythons: List = foldersWithPythons + .asSequence() + .filter { if (PyTestEnvVars.PYCHARM_PY_VERSION.isSet()) it.name.endsWith(PyTestEnvVars.PYCHARM_PY_VERSION.getValue()!!) else true } .filter(File::exists) .flatMap { it.listFiles()?.toList() ?: emptyList() } .plus(additionalInterpreters) .filter { it.isDirectory && !it.name.startsWith('.') } + .toList() /** * Configuration in readable format @@ -116,7 +119,12 @@ enum class PyTestEnvVars(private val getVarName: (PyTestEnvVars) -> String = { i /** * Only run remote-based tests */ - PYCHARM_RUN_REMOTE; + PYCHARM_RUN_REMOTE, + + /** + * Run only on one PY version + */ + PYCHARM_PY_VERSION; companion object {