Skip to content

Commit f5391ab

Browse files
committed
tests(PythonQtTestCleanup): Fix unknown attribute in testCallQtMethodInDel
This change ensures that the `QTimer` object is properly deleted to avoid the AttributeError when the `__del__` method is called. Fixes the following error: ``` Exception ignored in: <function TimerWrapper.__del__ at 0x510000073760> Traceback (most recent call last): File "<string>", line 6, in __del__ AttributeError: 'QTimer' object has no attribute 'setSingleShot' ```
1 parent fc5554e commit f5391ab

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tests/PythonQtTestCleanup.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ void PythonQtTestCleanup::testCallQtMethodInDel()
5454
" def __del__(self):\n" \
5555
" self.timer.setSingleShot(True)\n" \
5656
"x = TimerWrapper()\n" \
57+
"del x\n" \
5758
"obj.setPassed()\n"
5859
));
5960
}

0 commit comments

Comments
 (0)