use with self.assertRaises for readability

This commit is contained in:
Stefan Wojcik
2016-12-10 22:33:39 -05:00
parent a8884391c2
commit 3ebe3748fa
8 changed files with 206 additions and 326 deletions

View File

@@ -238,7 +238,8 @@ class TransformTest(unittest.TestCase):
box = [(35.0, -125.0), (40.0, -100.0)]
# I *meant* to execute location__within_box=box
events = Event.objects(location__within=box)
self.assertRaises(InvalidQueryError, lambda: events.count())
with self.assertRaises(InvalidQueryError):
events.count()
if __name__ == '__main__':