Skip to content

Commit d37dd07

Browse files
authored
Fix python state before / state after changes detection (#1919)
Fix state before - state after detection
1 parent 529ab98 commit d37dd07

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

utbot-python/src/main/kotlin/org/utbot/python/framework/codegen/model/constructor/tree/PythonCgMethodConstructor.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class PythonCgMethodConstructor(context: CgContext) : CgMethodConstructor(contex
6262
val afterThisInstance = execution.stateAfter.thisInstance
6363
val assertThisObject = emptyList<Pair<CgVariable, UtModel>>().toMutableList()
6464
if (beforeThisInstance is PythonTreeModel && afterThisInstance is PythonTreeModel) {
65-
if (beforeThisInstance != afterThisInstance) {
65+
if (PythonTreeWrapper(beforeThisInstance.tree) != PythonTreeWrapper(afterThisInstance.tree)) {
6666
thisInstance = thisInstance?.let {
6767
val newValue =
6868
if (it is CgPythonTree) {
@@ -91,7 +91,7 @@ class PythonCgMethodConstructor(context: CgContext) : CgMethodConstructor(contex
9191

9292
val afterValue = execution.stateAfter.parameters[index]
9393
if (afterValue is PythonTreeModel && param is PythonTreeModel) {
94-
if (afterValue != param) {
94+
if (PythonTreeWrapper(afterValue.tree) != PythonTreeWrapper(param.tree)) {
9595
if (argument !is CgVariable) {
9696
argument = newVar(argument.type, name) {argument}
9797
}

0 commit comments

Comments
 (0)