Repository navigation
Fix false boolean configuration values - #312
bensynapse wants to merge 2 commits into
Conversation
A false default must still select Starlette's boolean parser. Otherwise configuration strings such as false enable headers and optional storage error handling. Keep the existing path for other defaults.
|
Nice catch! Just wondering, maybe Because right now if someone passes |
|
Fixed in 93c53be. The condition now uses is not None, so zero defaults get their numeric type and False uses Starlette's boolean parser. |
I run Live Tennis API.
A
Falsedefault now uses Starlette's boolean parser when loading configuration. Previously,falseremained a nonempty string and enabled optional behavior.The tests cover environment variables and files, constructor defaults, invalid values, and HTTP header and storage failure behavior.
poetry run coverage run --omit="tests*" -m pytestpasses all 132 tests on Python 3.9, 3.10 and 3.11. Black, mypy,flake8 --select F401and coverage reporting also pass on all three versions. Twenty-one regression cases fail before the fix.Fixes #311.