[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    [PyQt] ANN: update to check_widget_snapshot() for widget appearance testing
From:       oliver <oliver.schoenborn () gmail ! com>
Date:       2016-11-28 4:10:27
Message-ID: CAMb+DaUFrH_Ep-Y9QzhdZO5HoeQZ3rj3HnsuDRRJOE_VxB4jyg () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


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
http://python.6.x6.nabble.com/Recipe-for-testing-with-snapshots-in-pyqt-tt5200821.html).
I have since extended its functionality significantly and put it on github
in https://github.com/schollii/sandals/blob/master/pyqt_test_sandals.py.

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.

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.

Feedback and contributions welcome!
Oliver

-- 
Oliver
My StackOverflow contributions
My CodeProject articles
My Github projects
My SourceForget.net projects

[Attachment #5 (text/html)]

<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-tt520 \
0821.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&#39;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>


[Attachment #6 (text/plain)]

_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
https://www.riverbankcomputing.com/mailman/listinfo/pyqt

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic