コード例 #1
0
def test_env_setting_returns_nicer_error_for_type_failure():
    func = settings.EnvSetting('port', 'PORT', type=int)

    with pytest.raises(settings.SettingError):
        func({'PORT': 'notanint'})
コード例 #2
0
def test_env_setting(setting, varname, type, environ, expected):
    func = settings.EnvSetting(setting, varname, type)

    result = func(environ)

    assert result == expected