@@ -7,6 +7,7 @@ import org.utbot.framework.plugin.api.UtError
77import org.utbot.framework.plugin.api.UtExecution
88import org.utbot.framework.plugin.api.UtExecutionSuccess
99import org.utbot.python.framework.api.python.PythonUtExecution
10+ import org.utbot.python.framework.api.python.util.pythonStrClassId
1011import org.utbot.python.fuzzing.*
1112import org.utbot.python.newtyping.*
1213import org.utbot.python.newtyping.ast.visitor.Visitor
@@ -137,10 +138,15 @@ class PythonTestCaseGenerator(
137138 var missingLines = initMissingLines
138139
139140 val (hintCollector, constantCollector) = constructCollectors(mypyStorage, typeStorage, method)
140- val constants = constantCollector.result.map { (type, value) ->
141- logger.debug { " Collected constant: ${type.pythonTypeRepresentation()} : $value " }
142- PythonFuzzedConcreteValue (type, value)
143- }
141+ val constants = constantCollector.result
142+ .mapNotNull { (type, value) ->
143+ if (type.pythonTypeName() == pythonStrClassId.name && value is String ) {
144+ // Filter doctests
145+ if (value.contains(" >>>" )) return @mapNotNull null
146+ }
147+ logger.debug { " Collected constant: ${type.pythonTypeRepresentation()} : $value " }
148+ PythonFuzzedConcreteValue (type, value)
149+ }
144150
145151 inferAnnotations(
146152 method,
@@ -154,7 +160,7 @@ class PythonTestCaseGenerator(
154160 ) { functionType ->
155161 val args = (functionType as FunctionType ).arguments
156162
157- logger.info { " Inferred annotations: ${args.joinToString { it.pythonTypeRepresentation() }} " }
163+ logger.debug { " Inferred annotations: ${args.joinToString { it.pythonTypeRepresentation() }} " }
158164
159165 val engine = PythonEngine (
160166 method,
@@ -222,7 +228,7 @@ class PythonTestCaseGenerator(
222228 val errors = mutableListOf<UtError >()
223229 val coveredLines = mutableSetOf<Int >()
224230
225- logger.info( " Start test generation for ${method.name} " )
231+ logger.info { " Start test generation for ${method.name} " }
226232 try {
227233 val methodModifications = mutableSetOf<Pair <PythonMethod , String >>() // Set of pairs <PythonMethod, additionalVars>
228234
@@ -247,10 +253,10 @@ class PythonTestCaseGenerator(
247253 )
248254 }
249255 } catch (_: OutOfMemoryError ) {
250- logger.info { " Out of memory error. Stop test generation process" }
256+ logger.debug { " Out of memory error. Stop test generation process" }
251257 }
252258
253- logger.info( " Collect all test executions for ${method.name} " )
259+ logger.info { " Collect all test executions for ${method.name} " }
254260 val (emptyCoverageExecutions, coverageExecutions) = executions.partition { it.coverage == null }
255261 val (successfulExecutions, failedExecutions) = coverageExecutions.partition { it.result is UtExecutionSuccess }
256262
0 commit comments