Make test more pythonic
Merge pull request #7430 from holmboe/pythonic-test

Make test more pythonic