From 1a741bb2a2759d9b20afc6160b5c7d58ec5ff382 Mon Sep 17 00:00:00 2001 From: Asif Saifuddin Auvi Date: Wed, 30 Nov 2016 17:12:01 +0600 Subject: [PATCH] converted asserts of exceptions test to pytest (#4723) --- tests/test_exceptions.py | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/tests/test_exceptions.py b/tests/test_exceptions.py index f1d172211..8b5628ef2 100644 --- a/tests/test_exceptions.py +++ b/tests/test_exceptions.py @@ -16,28 +16,22 @@ class ExceptionTestCase(TestCase): example = "string" lazy_example = _(example) - self.assertEqual( - _get_error_details(lazy_example), - example - ) + assert _get_error_details(lazy_example) == example + assert isinstance( _get_error_details(lazy_example), ErrorDetail ) - self.assertEqual( - _get_error_details({'nested': lazy_example})['nested'], - example - ) + assert _get_error_details({'nested': lazy_example})['nested'] == example + assert isinstance( _get_error_details({'nested': lazy_example})['nested'], ErrorDetail ) - self.assertEqual( - _get_error_details([[lazy_example]])[0][0], - example - ) + assert _get_error_details([[lazy_example]])[0][0] == example + assert isinstance( _get_error_details([[lazy_example]])[0][0], ErrorDetail