# -*- coding: utf-8 -*- """ test_footnote ~~~~~~~~~~~~~ Test for footnote and citation. :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from util import test_root, with_app def teardown_module(): (test_root / '_build').rmtree(True) @with_app(buildername='html') def test_html(app): app.builder.build(['footnote']) result = (app.outdir / 'footnote.html').text(encoding='utf-8') expects = [ '[1]', '[2]', '[3]', '[bar]', '[1]', '[2]', '[3]', '[bar]', ] for expect in expects: matches = re.findall(re.escape(expect), result) assert len(matches) == 1