From fce70828fcc0c85edf8f85a9685ffc4a419cc611 Mon Sep 17 00:00:00 2001 From: Simon Conseil Date: Sun, 31 Jan 2016 00:06:27 +0100 Subject: [PATCH] Reset logger level after the test --- tests/test_gallery.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/test_gallery.py b/tests/test_gallery.py index 865eceb..8de2cdc 100644 --- a/tests/test_gallery.py +++ b/tests/test_gallery.py @@ -233,10 +233,14 @@ def test_gallery(settings, tmpdir): assert 'Sigal test gallery' in html - logging.getLogger('sigal').setLevel(logging.DEBUG) - gal = Gallery(settings, ncpu=1) - with pytest.raises(SubprocessException): - gal.build() + logger = logging.getLogger('sigal') + logger.setLevel(logging.DEBUG) + try: + gal = Gallery(settings, ncpu=1) + with pytest.raises(SubprocessException): + gal.build() + finally: + logger.setLevel(logging.INFO) def test_empty_dirs(settings):