Skip to content

Commit 0ef96a7

Browse files
authored
[tests] fix flakiness of test_linkcheck_exclude_documents (#12189)
1 parent f44ff30 commit 0ef96a7

File tree

1 file changed

+17
-18
lines changed

1 file changed

+17
-18
lines changed

tests/test_builders/test_build_linkcheck.py

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,21 +1011,20 @@ def test_linkcheck_exclude_documents(app):
10111011
with open(app.outdir / 'output.json', encoding='utf-8') as fp:
10121012
content = [json.loads(record) for record in fp]
10131013

1014-
assert content == [
1015-
{
1016-
'filename': 'broken_link.rst',
1017-
'lineno': 4,
1018-
'status': 'ignored',
1019-
'code': 0,
1020-
'uri': 'https://www.sphinx-doc.org/this-is-a-broken-link',
1021-
'info': 'broken_link matched ^broken_link$ from linkcheck_exclude_documents',
1022-
},
1023-
{
1024-
'filename': 'br0ken_link.rst',
1025-
'lineno': 4,
1026-
'status': 'ignored',
1027-
'code': 0,
1028-
'uri': 'https://www.sphinx-doc.org/this-is-another-broken-link',
1029-
'info': 'br0ken_link matched br[0-9]ken_link from linkcheck_exclude_documents',
1030-
},
1031-
]
1014+
assert len(content) == 2
1015+
assert {
1016+
'filename': 'broken_link.rst',
1017+
'lineno': 4,
1018+
'status': 'ignored',
1019+
'code': 0,
1020+
'uri': 'https://www.sphinx-doc.org/this-is-a-broken-link',
1021+
'info': 'broken_link matched ^broken_link$ from linkcheck_exclude_documents',
1022+
} in content
1023+
assert {
1024+
'filename': 'br0ken_link.rst',
1025+
'lineno': 4,
1026+
'status': 'ignored',
1027+
'code': 0,
1028+
'uri': 'https://www.sphinx-doc.org/this-is-another-broken-link',
1029+
'info': 'br0ken_link matched br[0-9]ken_link from linkcheck_exclude_documents',
1030+
} in content

0 commit comments

Comments
 (0)