<div dir="ltr">A couple months ago I created a function check_widget_snapshot() that I discussed on codeproject, and announced it on the mailing list (see the archives at <a href="http://python.6.x6.nabble.com/Recipe-for-testing-with-snapshots-in-pyqt-tt5200821.html">http://python.6.x6.nabble.com/Recipe-for-testing-with-snapshots-in-pyqt-tt5200821.html</a>). I have since extended its functionality significantly and put it on github in <a href="https://github.com/schollii/sandals/blob/master/pyqt_test_sandals.py">https://github.com/schollii/sandals/blob/master/pyqt_test_sandals.py</a>. <div><div><br></div><div>The check_widget_snapshot() function makes it really easy to test that PyQt widget appearance has not changed since last time a test ran: if check_widget_snapshot() is called on a widget for which a snapshot has not been saved, the function creates the snapshot and saves to filesystem; otherwise, it compares the current widget's grab() against the saved file and, if different, it saves the actual and diff files and computes some metrics about the differences.</div></div><div><br></div><div>Although the check_widget_snapshot() code is tested with 100% coverage and is used in an actual project, some details could still change, esp. with regards to the generation of the difference image. Dependency injection can be used to customize the metrics and diff image computed.  </div><div><br></div><div>Feedback and contributions welcome!</div><div>Oliver</div><div><br></div></div><div dir="ltr">-- <br></div><div data-smartmail="gmail_signature"><div dir="ltr">Oliver<div>My StackOverflow contributions<br><div>My CodeProject articles</div></div><div>My Github projects</div><div>My SourceForget.net projects</div></div></div>