def test_tesseract_log_output(caplog, in_, logged): caplog.set_level(logging.INFO) tesseract.tesseract_log_output(in_) if logged == '': assert caplog.text == '' else: assert logged in caplog.text
def test_tesseract_log_output_raises(caplog): with pytest.raises(tesseract.TesseractConfigError): tesseract.tesseract_log_output(b'parameter not found: moo') assert 'not found' in caplog.text