QT has a very neat little module in it's C++ library called ModelTest. This is basically a little virtual tester that keeps a watch on your model's activity, and as certain aspects of the model or it's data change, it analyzes the changes, and tests if all the changes go through the expected cycle.
If you are not using QT, but are rather on the side of using PySide or PyQt, there is a Python Version of ModelTest. It saved me a ton of time just recently where I had some very hard-to-track issues that would pop up without recognizable patterns.
Using ModelTest is super simple:
... from ModelTest import ModelTest model = MyModel() parent.setModel(model) ModelTest(model, self) # Second argument simply needs to be a parent to attach ModelTest to. ...