def test_not_found(caplog):
 with caplog.at_level(logging.ERROR):
  data = jinja.render('does_not_exist.html')
 assert ('The does_not_exist.html template could not be found!' in data)
 assert caplog.records[0].msg.startswith('The does_not_exist.html template could not be loaded from')

def test_not_found ( caplog ) : with caplog . at_level ( logging . ERROR ) : data = jinja . render ( 'does_not_exist.html' ) assert ( 'The does_not_exist.html template could not be found!' in data ) assert caplog . records [ 0 ] . msg . startswith ( 'The does_not_exist.html template could not be loaded from' )
test with a template which does not exist .