Removed legacy usage of Union[]

This commit is contained in:
2024-12-26 18:36:57 +01:00
parent 95d04308bd
commit aa2c778a6a
13 changed files with 128 additions and 149 deletions

View File

@@ -1,8 +1,7 @@
from pathlib import Path
from typing import Any, List, Union
from typing import Any, List
import pytest
from libbot import i18n
@@ -21,7 +20,7 @@ from libbot import i18n
async def test_i18n_get(
key: str,
args: List[str],
locale: Union[str, None],
locale: str | None,
expected: Any,
location_locale: Path,
):
@@ -41,12 +40,8 @@ async def test_i18n_get(
("nested", ["callbacks", "default"], ["sure", "авжеж"]),
],
)
async def test_i18n_in_all_locales(
key: str, args: List[str], expected: Any, location_locale: Path
):
assert (
await i18n.in_all_locales(key, *args, locales_root=location_locale)
) == expected
async def test_i18n_in_all_locales(key: str, args: List[str], expected: Any, location_locale: Path):
assert (await i18n.in_all_locales(key, *args, locales_root=location_locale)) == expected
@pytest.mark.asyncio
@@ -58,9 +53,5 @@ async def test_i18n_in_all_locales(
("nested", ["callbacks", "default"], {"en": "sure", "uk": "авжеж"}),
],
)
async def test_i18n_in_every_locale(
key: str, args: List[str], expected: Any, location_locale: Path
):
assert (
await i18n.in_every_locale(key, *args, locales_root=location_locale)
) == expected
async def test_i18n_in_every_locale(key: str, args: List[str], expected: Any, location_locale: Path):
assert (await i18n.in_every_locale(key, *args, locales_root=location_locale)) == expected