Skip to main content

simple-settings plugin for pytest

Project description

pytest-simple-settings

PyPI 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.

Files for pytest-simple-settings, version 0.1.2
Filename, size File type Python version Upload date Hashes
Filename, size pytest_simple_settings-0.1.2-py2.py3-none-any.whl (3.8 kB) File type Wheel Python version py2.py3 Upload date Hashes View hashes
Filename, size pytest-simple-settings-0.1.2.tar.gz (2.3 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page