Python 3: Fix YamlEnvironmentTest tests

In Python 3, this happens:

>>> 'foo' in ValueError('foo')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: argument of type 'ValueError' is not iterable

We have to cast the Exception to make the tests work.

Change-Id: Ifc06c9860412030dc697b264812a6bf78e10eb8b
Merge "Python 3: Fix YamlEnvironmentTest tests"