Skip to content

Commit

Permalink
verify full record struct
Browse files Browse the repository at this point in the history
  • Loading branch information
croth1 committed Dec 6, 2021
1 parent ccf1866 commit d3f59c4
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions tests/test_build_linkcheck.py
Expand Up @@ -631,9 +631,24 @@ def test_get_after_head_raises_connection_error(app):
def test_linkcheck_exclude_documents(app):
app.build()

ignore_reg = re.compile('.* matched .* from linkcheck_exclude_documents')
with open(app.outdir / 'output.json') as fp:
for record in fp:
content = json.loads(record)
assert content['status'] == 'ignored'
assert ignore_reg.match(content['info'])
content = [json.loads(record) for record in fp]

assert content == [
{
'filename': 'broken_link.rst',
'lineno': 4,
'status': 'ignored',
'code': 0,
'uri': 'https://www.sphinx-doc.org/this-is-a-broken-link',
'info': 'broken_link matched ^broken_link$ from linkcheck_exclude_documents',
},
{
'filename': 'br0ken_link.rst',
'lineno': 4,
'status': 'ignored',
'code': 0,
'uri': 'https://www.sphinx-doc.org/this-is-another-broken-link',
'info': 'br0ken_link matched br[0-9]ken_link from linkcheck_exclude_documents',
},
]

0 comments on commit d3f59c4

Please sign in to comment.