test_translations: don't fail on rate limit (#35262)

skip translation test on 429
pull/35264/head
Adeeb Shihadeh 4 days ago committed by GitHub
parent 49c422e872
commit 5a67aa3618
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 9
      selfdrive/ui/tests/test_translations.py

@ -96,8 +96,15 @@ class TestTranslations:
match = re.search(r'_([a-zA-Z]{2,3})', self.file)
assert match, f"{self.name} - could not parse language"
response = requests.get(f"https://raw.githubusercontent.com/LDNOOBW/List-of-Dirty-Naughty-Obscene-and-Otherwise-Bad-Words/master/{match.group(1)}")
try:
response = requests.get(
f"https://raw.githubusercontent.com/LDNOOBW/List-of-Dirty-Naughty-Obscene-and-Otherwise-Bad-Words/master/{match.group(1)}"
)
response.raise_for_status()
except requests.exceptions.HTTPError as e:
if e.response is not None and e.response.status_code == 429:
pytest.skip("word list rate limited")
raise
banned_words = {line.strip() for line in response.text.splitlines()}

Loading…
Cancel
Save