Skip to content

Support to set env variables with code #187

@mLetrone

Description

@mLetrone

Hi, thank you for Pytest-env!
Currently, it's only possible to define the env variable inside .toml or .ini files, and that works great.
I think it would be a plus to be able to define these variables via code for IDE integration (go to), which would improve readability and centralize the logic.

I thought of something like this as an API

# conftest.py
class EnvTest(AutoEnvEnum):
      HOME = "~/tmp"
      RUN_ENV = 1

If you think it's a good idea, I would be happy to send a PR

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions