Minor improvements to test/utils.py