aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sources/shiboken6/tests/samplebinding/objecttype_test.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/sources/shiboken6/tests/samplebinding/objecttype_test.py b/sources/shiboken6/tests/samplebinding/objecttype_test.py
index 58036a458..d648a9156 100644
--- a/sources/shiboken6/tests/samplebinding/objecttype_test.py
+++ b/sources/shiboken6/tests/samplebinding/objecttype_test.py
@@ -129,11 +129,8 @@ class ObjectTypeTest(unittest.TestCase):
def testInvalidProperty(self):
o = ObjectType()
- try:
+ with self.assertRaises(AttributeError):
o.typo
- self.assertFail()
- except AttributeError as error:
- self.assertEqual(error.args[0], "'sample.ObjectType' object has no attribute 'typo'")
if __name__ == '__main__':
unittest.main()