Skip the actions test on CI if html5-parser is too old

This commit is contained in:
Kovid Goyal 2021-11-10 22:09:39 +05:30
parent 0d0c9c3f02
commit cb263c1175
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 9 additions and 3 deletions

View File

@ -13,8 +13,5 @@ file_to_patch=$(pacman -Ql python-pycryptodome | grep _raw_api.py$ | cut -d" " -
echo "Patching $file_to_patch"
sed -i 's/RTLD_DEEPBIND/RTLD_DEEPBIND_DISABLED_BY_KOVID/g' "$file_to_patch"
# Needed till html5-parser 0.4.10 is available
pip install -U html5-parser
useradd -m ci
chown -R ci:users $GITHUB_WORKSPACE

View File

@ -470,6 +470,15 @@ def test(return_tests=False): # {{{
self.ae(rule, next(iter(import_rules(export_rules([rule])))))
def test_html_transform_actions(self):
try:
parse('a', fragment_context='div')
except TypeError:
import os
is_ci = os.environ.get('CI', '').lower() == 'true'
if is_ci:
raise unittest.SkipTest('html5-parser too old on CI')
else:
raise
def r(html='<p>hello'):
return parse(namespace_elements=True, html=html)[1]