Remove a test that cannot be fixed - less garbage in CI check output

This commit is contained in:
Alexey Milovidov 2021-03-14 14:45:47 +03:00
parent ef4913d184
commit b65cc841e4

View File

@ -68,17 +68,17 @@ def test_single_page(input_path, lang):
f,
features='html.parser'
)
anchor_points = set()
duplicate_anchor_points = 0
links_to_nowhere = 0
for tag in soup.find_all():
for anchor_point in [tag.attrs.get('name'), tag.attrs.get('id')]:
if anchor_point:
if anchor_point in anchor_points:
duplicate_anchor_points += 1
logging.info('Duplicate anchor point: %s' % anchor_point)
else:
anchor_points.add(anchor_point)
anchor_points.add(anchor_point)
for tag in soup.find_all():
href = tag.attrs.get('href')
if href and href.startswith('#') and href != '#':
@ -87,11 +87,8 @@ def test_single_page(input_path, lang):
logging.info("Tag %s", tag)
logging.info('Link to nowhere: %s' % href)
if duplicate_anchor_points:
logging.warning('Found %d duplicate anchor points' % duplicate_anchor_points)
if links_to_nowhere:
if lang == 'en' or lang == 'ru': # TODO: check all languages again
if lang == 'en' or lang == 'ru':
logging.error(f'Found {links_to_nowhere} links to nowhere in {lang}')
sys.exit(1)
else: