Fix unit tests to have accurate return code.

Before 'tox -epy27' would not fail even if a unit test failed.

Change-Id: I3ed43fdd78d0d877b93b59e2eaaf5de289a17259