The EnvVarContext
captures an environment variable.
It can be created using the capsula.EnvVarContext.__init__
method.
::: capsula.EnvVarContext.init
[pre-run]
contexts = [
{ type = "EnvVarContext", name = "HOME" },
]
import capsula
@capsula.run()
@capsula.context(capsula.EnvVarContext("HOME"), mode="pre")
def func(): ...
The following is an example of the output of the EnvVarContext
, reported by the JsonDumpReporter
:
"env": {
"HOME": "/home/nomura"
}