Skip to content

Commit

Permalink
Use assertRaises instead of try/catch for test
Browse files Browse the repository at this point in the history
Signed-off-by: Alastair Porter <alastair@porter.net.nz>
  • Loading branch information
alastair committed Nov 23, 2015
1 parent c05e868 commit b86d01b
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions test/test_getentity.py
Expand Up @@ -133,9 +133,7 @@ def testGetInstrument(self):
self.assertEqual("http://musicbrainz.org/ws/2/instrument/d00cec5f-f9bc-4235-a54f-6639a02d4e4c?inc=aliases+annotation", self.opener.get_url())

# Ratings are used on almost all other entites but instrument
try:
musicbrainzngs.get_instrument_by_id("dabdeb41-560f-4d84-aa6a-cf22349326fe", includes=["ratings"])
self.assertFalse("Should not be able to include ratings")
except musicbrainzngs.InvalidIncludeError:
pass
self.assertRaises(musicbrainzngs.UsageError,
musicbrainzngs.get_instrument_by_id,
"dabdeb41-560f-4d84-aa6a-cf22349326fe", includes=["ratings"])

0 comments on commit b86d01b

Please sign in to comment.