@ -296,7 +296,7 @@ class TestUtils(unittest.TestCase):
try :
ansible . utils . process_yaml_error ( exc , data , __file__ )
except ansible . errors . AnsibleYAMLValidationFailed , e :
self . assertTrue ( ' Syntax Error while loading ' in e . msg )
self . assertTrue ( ' Syntax Error while loading ' in str ( e ) )
else :
raise AssertionError ( ' Incorrect exception, expected AnsibleYAMLValidationFailed ' )
@ -307,7 +307,7 @@ class TestUtils(unittest.TestCase):
try :
ansible . utils . process_yaml_error ( exc , data , __file__ )
except ansible . errors . AnsibleYAMLValidationFailed , e :
self . assertTrue ( ' Syntax Error while loading ' in e . msg )
self . assertTrue ( ' Syntax Error while loading ' in str ( e ) )
else :
raise AssertionError ( ' Incorrect exception, expected AnsibleYAMLValidationFailed ' )
@ -318,7 +318,7 @@ class TestUtils(unittest.TestCase):
try :
ansible . utils . process_yaml_error ( exc , data , __file__ )
except ansible . errors . AnsibleYAMLValidationFailed , e :
self . assertTrue ( ' Check over ' in e . msg )
self . assertTrue ( ' Check over ' in str ( e ) )
else :
raise AssertionError ( ' Incorrect exception, expected AnsibleYAMLValidationFailed ' )
@ -329,7 +329,7 @@ class TestUtils(unittest.TestCase):
try :
ansible . utils . process_yaml_error ( exc , data , None )
except ansible . errors . AnsibleYAMLValidationFailed , e :
self . assertTrue ( ' Could not parse YAML. ' in e . msg )
self . assertTrue ( ' Could not parse YAML. ' in str ( e ) )
else :
raise AssertionError ( ' Incorrect exception, expected AnsibleYAMLValidationFailed ' )
@ -355,7 +355,7 @@ class TestUtils(unittest.TestCase):
try :
ansible . utils . parse_yaml_from_file ( broken )
except ansible . errors . AnsibleYAMLValidationFailed , e :
self . assertTrue ( ' Syntax Error while loading ' in e . msg )
self . assertTrue ( ' Syntax Error while loading ' in str ( e ) )
else :
raise AssertionError ( ' Incorrect exception, expected AnsibleYAMLValidationFailed ' )
@ -597,8 +597,8 @@ class TestUtils(unittest.TestCase):
try :
ansible . utils . deprecated ( ' Ack! ' , ' 0.0 ' , True )
except ansible . errors . AnsibleError , e :
self . assertTrue ( ' 0.0 ' not in e . msg )
self . assertTrue ( ' [DEPRECATED] ' in e . msg )
self . assertTrue ( ' 0.0 ' not in str ( e ) )
self . assertTrue ( ' [DEPRECATED] ' in str ( e ) )
else :
raise AssertionError ( " Incorrect exception, expected AnsibleError " )