MobileDynasty / pytest-env

pytest plugin used to set environment variables
MIT License
218 stars 23 forks source link

feat: add ability to use env-vars with a python-like syntax. #5

Closed jsmedmar closed 7 years ago

jsmedmar commented 7 years ago

This pull request enables the use environment variables in the test env configuration using:

@pytest.hookimpl(tryfirst=True)
def pytest_load_initial_conftests(args, early_config, parser):
    ...
    # Replace environment variables in value. for instance:
    # RUN_PATH=/run/path/{USER}
    value = value.format(**os.environ)
    ...

This functionality has been documented in the README.md. Additionally, I added some simple docs and pep8 styling changes. I think this change is worth increasing the version to 0.6.2, I updated the setup.py accordingly.

I also changed the RST format to markdown since the file was called README.md.

jsmedmar commented 7 years ago

Do you think this is a feature you may want to include in the package?

lbud4 commented 7 years ago

I like it. Will merge it.