Can this go in `test/utils.py` as it seems more appropriate for general use?