Skip to content

Commit 1a741bb

Browse files
auvipytomchristie
authored andcommitted
converted asserts of exceptions test to pytest (encode#4723)
1 parent 6e30dc7 commit 1a741bb

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

tests/test_exceptions.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,22 @@ def test_get_error_details(self):
1616
example = "string"
1717
lazy_example = _(example)
1818

19-
self.assertEqual(
20-
_get_error_details(lazy_example),
21-
example
22-
)
19+
assert _get_error_details(lazy_example) == example
20+
2321
assert isinstance(
2422
_get_error_details(lazy_example),
2523
ErrorDetail
2624
)
2725

28-
self.assertEqual(
29-
_get_error_details({'nested': lazy_example})['nested'],
30-
example
31-
)
26+
assert _get_error_details({'nested': lazy_example})['nested'] == example
27+
3228
assert isinstance(
3329
_get_error_details({'nested': lazy_example})['nested'],
3430
ErrorDetail
3531
)
3632

37-
self.assertEqual(
38-
_get_error_details([[lazy_example]])[0][0],
39-
example
40-
)
33+
assert _get_error_details([[lazy_example]])[0][0] == example
34+
4135
assert isinstance(
4236
_get_error_details([[lazy_example]])[0][0],
4337
ErrorDetail

0 commit comments

Comments
 (0)