mirror of
https://github.com/kennethreitz/pydantic.git
synced 2026-06-05 23:00:18 +00:00
18 lines
347 B
Python
18 lines
347 B
Python
from pydantic import BaseSettings
|
|
|
|
|
|
class SimpleSettings(BaseSettings):
|
|
apple: str = ...
|
|
|
|
|
|
def test_sub_env(env):
|
|
env.set('APP_APPLE', 'hello')
|
|
s = SimpleSettings()
|
|
assert s.apple == 'hello'
|
|
|
|
|
|
def test_sub_env_override(env):
|
|
env.set('APP_APPLE', 'hello')
|
|
s = SimpleSettings(apple='goodbye')
|
|
assert s.apple == 'goodbye'
|