Document the use of pytest with dynaconf
See original GitHub issueFor testing in my project i want to add in my conftest.py something like that:
import pytest
import os
@pytest.fixture(scope='session', autouse=True)
def settings():
os.environ['ENV_FOR_DYNACONF'] = 'testing'
But this is not work 😭. What can you advise me ?
I dont want start my test like that : ENV_FOR_DYNACONF=testing pytest
because somebody can miss that command prefix and mess up some dev data.
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (8 by maintainers)
Top Results From Across the Web
Document the use of pytest with dynaconf · Issue #203 - GitHub
For testing in my project i want to add in my conftest.py something like that: import pytest import os @pytest.fixture(scope='session', ...
Read more >Testing — dynaconf 2.2.3 documentation - Read the Docs
For pytest it is common to create fixtures to provide pre-configured settings object or to configure the settings before all the tests are...
Read more >Advanced usage - Dynaconf - 3.1.11
Programmatically loading a settings file¶. from dynaconf import settings settings.load_file ...
Read more >How to Write a Configuration file in Python - The Tech Platform
Which format of the configuration file should I use? ... import pytest from dynaconf import settings @pytest.fixture(scope="session", ...
Read more >validate yaml file with dynaconf or schema in python
... "app.args.arg3", must_exist=True, ), ] @pytest.fixture def yaml_validators_bad(): return [ Validator("missing.value", must_exist=True), ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I am reopening this issue because I think we should add this to our documentation!
Thank you!
@gabicavalcante I updated the PR and made
dynaconf.settings
to be always inded toapp.config
so you can use both and this confusion will not happen again, thanks for the insight.@thomaszdxsn I think the PR also solves the Django problem.