mirror of
https://github.com/beetbox/beets.git
synced 2025-12-26 02:24:33 +01:00
using asserRaises in test instead of previous workaround
used a workaround with try and except to check for a raised Exception before
This commit is contained in:
parent
57452624ae
commit
d607ae7adc
1 changed files with 2 additions and 8 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Reference in a new issue