Skip to content

Latest commit

 

History

History
37 lines (26 loc) · 726 Bytes

envvar.md

File metadata and controls

37 lines (26 loc) · 726 Bytes

EnvVarContext

The EnvVarContext captures an environment variable. It can be created using the capsula.EnvVarContext.__init__ method.

::: capsula.EnvVarContext.init

Configuration example

Via capsula.toml

[pre-run]
contexts = [
  { type = "EnvVarContext", name = "HOME" },
]

Via @capsula.context decorator

import capsula

@capsula.run()
@capsula.context(capsula.EnvVarContext("HOME"), mode="pre")
def func(): ...

Output example

The following is an example of the output of the EnvVarContext, reported by the JsonDumpReporter:

"env": {
  "HOME": "/home/nomura"
}