Skip to content

Commit

Permalink
ops
Browse files Browse the repository at this point in the history
  • Loading branch information
7h3Rabbit committed Oct 15, 2023
1 parent f2b1f0f commit bd88e26
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
1 change: 0 additions & 1 deletion tests/html_validator_w3c.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ def run_test(_, langCode, url):


error_message_grouped_dict = {}
error_message_grouped_for_rating_dict = {}
if number_of_errors > 0:
regex = r"(“[^”]+”)"
for item in errors:
Expand Down
11 changes: 7 additions & 4 deletions tests/w3c_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@ def get_errors(test_type, params):
arg = ''
test_arg = ''
errors = list()
is_html = False

if 'css' in params or test_type == 'css':
test_arg = ' --css --skip-non-css'
if 'html' in params or test_type == 'html':
test_arg = ' --html --skip-non-html'
is_html = True

if 'doc' in params:
url = params['doc']
Expand All @@ -39,10 +41,11 @@ def get_errors(test_type, params):
'Tested url must start with \'https://\' or \'http://\': {0}'.format(url))

file_path = get_cache_path(url, True)
html_file_ending_fix = file_path.replace('.cache', '.cache.html')
if has_cache_file(url, True, cache_time_delta) and not os.path.exists(file_path):
os.rename(file_path, html_file_ending_fix)
file_path = html_file_ending_fix
if is_html:
html_file_ending_fix = file_path.replace('.cache', '.cache.html')
if has_cache_file(url, True, cache_time_delta) and not os.path.exists(html_file_ending_fix):
os.rename(file_path, html_file_ending_fix)
file_path = html_file_ending_fix

arg = '--exit-zero-always{1} --stdout --format json --errors-only {0}'.format(
file_path, test_arg)
Expand Down

0 comments on commit bd88e26

Please sign in to comment.