envparse
envparse copied to clipboard
Feature/schema-env-processors-fix
This change enables a user to utilise a preprocessor or a postprocessor with the schema syntax. E.g.
test_env = Env(TEST=dict(cast=str, preprocessor=lambda v: v.upper()))
Prior to this, the pre/post processors would not fire, as they were not checked within the schema value. As such, the above code would show that the value of test_env('TEST') was hello, rather than HELLO if the processor had been applied. With this small addition, they now fire and work as I expected them too. I have added the accompanying tests too.
I hope this makes sense, feel free to make any alterations or comments as required.