Skip to content

Commit

Permalink
try,except -> idiomatic self.assertRaises
Browse files Browse the repository at this point in the history
  • Loading branch information
dhakim87 committed Apr 18, 2020
1 parent 694c08e commit 9e818b5
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions microsetta_private_api/admin/tests/test_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def test_scan_barcode(self):
self.assertEqual(diag['barcode_info'][0]['status'],
prestatus)

try:
with self.assertRaises(NotFound):
admin_repo.scan_barcode(
"THIZIZNOTAREALBARCODEISWARE",
{
Expand All @@ -160,5 +160,3 @@ def test_scan_barcode(self):
}
)
self.fail("Shouldn't get here")
except NotFound:
pass

0 comments on commit 9e818b5

Please sign in to comment.