Found it. I overlooked the following traceback in the logs.
Traceback (most recent call last):
File "/mnt/ssd2/develop/experiments/python-squish/mysquishtest.py", line 16, in <module>
squishtest.waitForApplicationLaunch()
RuntimeError: Waiting for application timed out
When I remove the call squishtest.waitForApplicationLaunch() it works and I can use squishtest.test.compare() to test conditions.