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 {