tests: silence logging output

This commit is contained in:
Adrian Sampson 2014-01-20 15:58:33 -08:00
parent 72c6b6feba
commit 61b6f04036
2 changed files with 8 additions and 6 deletions

View file

@ -34,10 +34,6 @@ from beets import importer
from beets.ui import commands
import beets
# Suppress logging output.
log = logging.getLogger('beets')
log.setLevel(logging.CRITICAL)
# Test resources/sandbox path.
RSRC = os.path.join(os.path.dirname(__file__), 'rsrc')
@ -113,6 +109,10 @@ class TestCase(unittest.TestCase):
# Initialize, but don't install, a DummyIO.
self.io = DummyIO()
# Suppress logging output.
log = logging.getLogger('beets')
log.setLevel(logging.CRITICAL)
def tearDown(self):
if os.path.isdir(self.temp_dir):
shutil.rmtree(self.temp_dir)

View file

@ -39,7 +39,7 @@ class MockUrlRetrieve(object):
self.fetched = url
return filename or self.pathval, self.headers
class FetchImageTest(unittest.TestCase):
class FetchImageTest(_common.TestCase):
def test_invalid_type_returns_none(self):
fetchart.urllib.urlretrieve = MockUrlRetrieve('')
artpath = fetchart._fetch_image('http://example.com')
@ -168,12 +168,14 @@ class CombinedTest(_common.TestCase):
self.assertFalse(self.urlopen_called)
self.assertFalse(mock_retrieve.fetched)
class AAOTest(unittest.TestCase):
class AAOTest(_common.TestCase):
def setUp(self):
super(AAOTest, self).setUp()
self.old_urlopen = fetchart.urllib.urlopen
fetchart.urllib.urlopen = self._urlopen
self.page_text = ''
def tearDown(self):
super(AAOTest, self).tearDown()
fetchart.urllib.urlopen = self.old_urlopen
def _urlopen(self, url):