diff --git a/test/test_ui_commands.py b/test/test_ui_commands.py index c52c3aad0..05da727fd 100644 --- a/test/test_ui_commands.py +++ b/test/test_ui_commands.py @@ -53,18 +53,12 @@ class QueryTest(_common.TestCase): return album def test_query_empty(self): - try: + with self.assertRaises(ui.UserError): items, albums = commands._do_query(self.lib, (), False) - raise Exception("A UserError should have been raised") - except ui.UserError: - pass def test_query_empty_album(self): - try: + with self.assertRaises(ui.UserError): items, albums = commands._do_query(self.lib, (), True) - raise Exception("A UserError should have been raised") - except ui.UserError: - pass def test_query_item(self): item, itempath = self.add_item()