From e2f8849dbaa5706350ac1f5da927f0df0711abb8 Mon Sep 17 00:00:00 2001 From: Roman Mogylatov Date: Mon, 20 Dec 2021 18:45:28 +0200 Subject: [PATCH] Add typing tests --- tests/typing/configuration.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/typing/configuration.py b/tests/typing/configuration.py index b6005004..4a4c7f95 100644 --- a/tests/typing/configuration.py +++ b/tests/typing/configuration.py @@ -14,7 +14,11 @@ config2.from_ini(Path("config.ini")) config2.from_yaml("config.yml") config2.from_yaml(Path("config.yml")) + config2.from_env("ENV", "default") +config2.from_env("ENV", as_=int, default=123) +config2.from_env("ENV", as_=float, required=True) +config2.from_env("ENV", as_=lambda env: str(env)) # Test 3: to check as_*() methods config3 = providers.Configuration()