# All configuration values have a default; values that are commented out
# serve to show the default.
-import sys, os
+import sys
+import os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
select = [
"B",
"C",
+ "E",
]
ignore = [
"C901", # Complexity
"E501", # Line length
+ "E731", # Do not assign a lambda expression (we use them on purpose)
"E741", # Ambiguous variable name
]
extend-exclude = [
"tests/messages/data",
]
+[tool.ruff.per-file-ignores]
+"scripts/import_cldr.py" = ["E402"]
# Instead, it's better to return None altogether, as we can't reliably format
# part of a language name.
- assert Locale.parse('fi_FI').get_display_name('kw_GB') == None
+ assert Locale.parse('fi_FI').get_display_name('kw_GB') is None
def test_issue_814():
normalized_locale = localedata.normalize_locale(None)
assert normalized_locale is None
locale_exist = localedata.exists(None)
- assert locale_exist == False
+ assert locale_exist is False
# # Testing list input.
normalized_locale = localedata.normalize_locale(['en_us', None])
assert normalized_locale is None
locale_exist = localedata.exists(['en_us', None])
- assert locale_exist == False
+ assert locale_exist is False
def test_locale_identifiers_cache(monkeypatch):
def test_is_currency():
- assert is_currency('EUR') == True
- assert is_currency('eUr') == False
- assert is_currency('FUU') == False
- assert is_currency('') == False
- assert is_currency(None) == False
- assert is_currency(' EUR ') == False
- assert is_currency(' ') == False
- assert is_currency([]) == False
- assert is_currency(set()) == False
+ assert is_currency('EUR') is True
+ assert is_currency('eUr') is False
+ assert is_currency('FUU') is False
+ assert is_currency('') is False
+ assert is_currency(None) is False
+ assert is_currency(' EUR ') is False
+ assert is_currency(' ') is False
+ assert is_currency([]) is False
+ assert is_currency(set()) is False
def test_normalize_currency():
assert util.FixedOffsetTimezone(330).zone == 'Etc/GMT+330'
-parse_encoding = lambda s: util.parse_encoding(BytesIO(s.encode('utf-8')))
+def parse_encoding(s):
+ return util.parse_encoding(BytesIO(s.encode('utf-8')))
def test_parse_encoding_defined():