ci ttfw: Consistently handle unexpected exceptions in test cases

This commit is contained in:
Angus Gratton
2020-12-31 10:58:28 +11:00
parent cee0e17b7f
commit 441d1306be
4 changed files with 20 additions and 9 deletions

View File

@@ -439,7 +439,7 @@ class BaseDUT(object):
if isinstance(data, type(u'')):
try:
data = data.encode('utf-8')
except Exception as e:
except UnicodeEncodeError as e:
print(u'Cannot encode {} of type {}'.format(data, type(data)))
raise e
return data