File tree Expand file tree Collapse file tree
utbot-python/src/main/kotlin/org/utbot/python Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -144,15 +144,18 @@ object PythonTestGenerationProcessor {
144144 }
145145 }
146146 val importResultModules = notEmptyTests.flatMap { testSet ->
147- testSet.executions.flatMap { execution ->
148- (execution.result as UtExecutionSuccess ).let { result ->
149- (result.model as PythonModel ).let {
150- it.allContainingClassIds.map { classId ->
151- PythonUserImport (classId.moduleName)
147+ testSet.executions.mapNotNull { execution ->
148+ if (execution.result is UtExecutionSuccess ) {
149+ (execution.result as UtExecutionSuccess ).let { result ->
150+ (result.model as PythonModel ).let {
151+ it.allContainingClassIds.map { classId ->
152+ PythonUserImport (classId.moduleName)
153+ }
152154 }
153155 }
154156 }
155- }
157+ else null
158+ }.flatten()
156159 }
157160 val testRootModules = notEmptyTests.mapNotNull { testSet ->
158161 methodIds[testSet.method]?.rootModuleName?.let { PythonUserImport (it) }
You can’t perform that action at this time.
0 commit comments