summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Freeze format_time() tests to a specific date to fix test failures (#998)HEADmasterMichał Górny2023-05-091-5/+6
| | | | | | | | Freeze the date when performing the tests for format_time() with a timezone specified. Since the time object does not specify a date, the formatter uses the format string specific to the current date. As a result, if the current DST state is different than when the test was last updated, it failed.
* Use Python 3 syntax in test fixturesAarni Koskela2023-03-013-3/+3
|
* Update copyright year to 2023Aarni Koskela2023-02-2814-14/+14
|
* Turn off difflib "autojunk" heuristic in fuzzy matchingJean Abou Samra2023-02-121-0/+19
| | | | | | | | | difflib has a heuristic that used to make fuzzy matching unreliable for >200char strings. See https://github.com/python/cpython/issues/90825 Fixes #969
* In fuzzy matching, also .lower().strip() fuzzy candidatesJean Abou Samra2023-02-121-5/+5
| | | | | | | This seems intended at easing fuzzy matching with trivial edits in the msgstr (changing case and adding whitespace), but it was only done on the new msgstr, not on the old mgstr candidates, so it was possible for merging catalogs to miss messages.
* Replace babel.localedata.locale_identifiers cache with LRU cacheAarni Koskela2023-02-071-8/+5
|
* Keep @modifiers when parsing locales (#947)martin f. krafft2023-01-261-2/+4
| | | | | | | | | | | | | | | | | Locale modifiers ("@variants") are described in the GNU gettext documentation like this: > The ‘@variant’ can denote any kind of characteristics that is not > already implied by the language ll and the country CC. […] It can also > denote a dialect of the language, … Wherein Babel previously would discard these, this patch stores the modifier information in the `Locale` objects, handling string representation accordingly. Resolves: #946 Signed-off-by: martin f. krafft <madduck@madduck.net> Co-authored-by: Aarni Koskela <akx@iki.fi>
* Support for formatting NaN, Infinity (#955)Jonah Lawrence2023-01-251-0/+10
|
* Remove redundant tests for babel.support (#954)Aarni Koskela2023-01-201-38/+4
| | | The doctests test the exact same things.
* Adjust tests for CLDR 42Aarni Koskela2023-01-205-23/+27
| | | | | | | The space changes around English seem to be on purpose, see: * https://unicode-org.atlassian.net/browse/CLDR-14032 * https://github.com/unicode-org/cldr/commit/a83026ab8c8fa6ed88f1047c4d0c6089f88b7e5d
* Add test for #942Aarni Koskela2023-01-201-0/+4
|
* Enable E741 (ambiguous variable name) lintAarni Koskela2023-01-183-39/+39
|
* Apply some small miscellaneous formatting fixesAarni Koskela2023-01-186-34/+36
|
* Apply ruff UP025 (unicode literal prefix) fixAarni Koskela2023-01-1813-420/+420
|
* Apply ruff SIM300 (de-yoda) fixesAarni Koskela2023-01-181-5/+4
|
* Apply ruff I category fixesAarni Koskela2023-01-1815-27/+49
|
* Apply ruff E category fixesAarni Koskela2023-01-184-13/+14
|
* Apply ruff C category fixesAarni Koskela2023-01-181-15/+9
|
* Renovate formatting in test_checkers and test_frontend (#950)Aarni Koskela2023-01-182-204/+147
|
* Minor cleanups (#948)Aarni Koskela2023-01-185-35/+31
| | | | | * Add __all__s to be cleaner about re-exports * Move timezone_getter to conftest * Apply spelling corrections suggested by codespell
* Implement zoneinfo support and make pytz optional (#940)DS/Charlie2023-01-113-93/+108
|
* Fix compact singular formats and patterns with no numbers (#932)Jonah Lawrence2023-01-061-1/+6
|
* Improved javascript template string expression extracting (#939)Johannes Wilm2023-01-061-0/+39
| | | | Co-authored-by: Rik <gitaarik@posteo.net> Co-authored-by: Aarni Koskela <akx@iki.fi>
* Replace %/.format/concatenation with f-strings where feasible (#927)Aarni Koskela2022-11-236-16/+17
| | | Original conversion suggestions via flynt, edited by hand.
* feat: Support for short compact currency formats (#926)Jonah Lawrence2022-11-042-0/+34
| | | | Co-authored-by: Jun Omae (大前 潤) <42682+jun66j5@users.noreply.github.com>
* feat: Add `Format.compact_decimal` utility (#921)Jonah Lawrence2022-11-021-0/+5
|
* Quiesce pytest warnings (#916)Aarni Koskela2022-11-011-1/+1
| | | | | | | * Skip doctest of deprecated format_number * Don't return from test_compatible_classes_in_global_and_localedata * Renovate conftest (and require pytest 6+)
* Use `ast` instead of `eval` for string extractionAarni Koskela2022-11-011-0/+27
| | | | | | | | This is safer (as we don't actually execute anything), and allows us to parse f-strings too. Closes #769 (supersedes it) Refs #715 (doesn't add an error yet, but doesn't crash on f-strings)
* Add support for compact decimal formats (#909)Jonah Lawrence2022-10-311-0/+33
|
* Support for hex escapes in JavaScript string literalsPrzemyslaw Wegrzyn2022-10-311-0/+2
|
* Use email.Message for pofile header parsingAarni Koskela2022-05-101-0/+11
| | | | | | cgi.parse_header is due to be deprecated Fixes #873
* tests: Use pytest.raises() decorator where applicableAarni Koskela2022-05-102-19/+17
|
* tests: Use regular asserts instead of unittest functionsAarni Koskela2022-05-1010-879/+639
| | | | | | Automated conversion initially applied with https://github.com/warlo/codemod-unittest-to-pytest-asserts, followed by some manual changes for brevity.
* Merge pull request #869 from jun66j5/date-period-symbolsAarni Koskela2022-05-101-1/+1
|\ | | | | Add support for `b` and `B` period symbols in time format
| * Add support for `b` and `B` period symbols in time formatJun Omae2022-04-291-1/+1
| |
* | Fix up some Python2-isms using pyupgradeAarni Koskela2022-05-1021-28/+4
| |
* | Fix get_period_id() with `dayPeriodRule` across 0:00Jun Omae2022-05-101-0/+3
| |
* | Fallback count="other" format in format_currency()Jun Omae2022-05-101-0/+6
|/
* Add test for issue 798Aarni Koskela2022-04-201-0/+4
|
* allow header_comment to be passed as an option to extract_message (#720)Mohamed Morsy2022-04-121-0/+9
| | | | | Fixes #82 Co-authored-by: Aarni Koskela <akx@iki.fi>
* Update tests for CLDR 41Aarni Koskela2022-04-081-1/+1
|
* Provide a way of checking if the catalogs are up-to-date (#831)Krzysztof Jagiełło2022-04-081-1/+59
|
* Fix output of --list-locales to not be a bytes reprMorgan Wahl2022-04-081-0/+11
| | | | Co-authored-by: Aarni Koskela <akx@iki.fi>
* Make test_smoke more thoroughAarni Koskela2022-04-081-13/+32
|
* plural: parse new c, e operands (otherwise unsupported though)Aarni Koskela2022-04-081-1/+3
|
* Adjust tests for CLDR 40 dataAarni Koskela2022-04-082-5/+5
|
* Plural-Forms: Fix missing trailing semicolonfarhan59002022-04-0810-29/+29
| | | | | | | | Adds missing semicolon in the code that generates the header that is Catalog.plural_forms as well as in plural.to_gettext function. Also modifies all the concerning test cases as well as test data files. Closes https://github.com/python-babel/babel/issues/836
* Prefer setuptools imports to distutils importsAarni Koskela2022-04-081-17/+12
| | | | | | | The non-conditional imports have been around for 6 to 17 years, so they should be safe in conservative situations too. Refs #824
* Fix duplicate locations when writing without linenoSigurd Ljødal2022-04-081-0/+1
| | | | | | If the same translation appears multiple times in the same file, duplicate locations would be written to the .po file when using write_po(..., include_lineno=False).
* Don't use the deprecated format_number function internally or in testsAarni Koskela2022-02-041-5/+2
|