Make test more pythonic