tests: standardize to modern 'except FooError as err:' syntax
Merge pull request #4816 from hulu/except-as-tests

standardize to modern 'except FooError as err:' syntax in test files