Skip to main content

simple-settings plugin for pytest

Project description

pytest-simple-settings

PyPI version PyPI - Python Version Build Status

Usage

With default simple_settings.settings:

from simple_settings import settings


def test_foo(fake_settings):
    fake_settings.FOO = 1
    fake_settings.set(BAR=2)

    assert settings.FOO == 1
    assert settings.BAR == 2

With custom LazySettings instance

import pytest
from simple_settings import LazySettings


instance = LazySettings('settings')


@pytest.fixture()
def settings_instance():
    return instance


def test_foo(fake_settings):
    fake_settings.FOO = 1
    fake_settings.set(BAR=2)

    assert instance.FOO == 1
    assert instance.BAR == 2

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytest-simple-settings-0.1.5.tar.gz (2.6 kB view hashes)

Uploaded Source

Built Distribution

pytest_simple_settings-0.1.5-py2.py3-none-any.whl (3.8 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page