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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 2 Python 3

File details

Details for the file pytest-simple-settings-0.1.5.tar.gz.

File metadata

  • Download URL: pytest-simple-settings-0.1.5.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.9.0

File hashes

Hashes for pytest-simple-settings-0.1.5.tar.gz
Algorithm Hash digest
SHA256 30dd0a7ebf1e7e4a2f2d70afe50e47f4d2073499bb9d3fb22fab2f57eb8528e4
MD5 5dde298e7f89e920397c8c7fd22a6087
BLAKE2b-256 f593f585cb649fad2cfcb95f083f5503465606456846f3d7bfcd9bde17bfb803

See more details on using hashes here.

File details

Details for the file pytest_simple_settings-0.1.5-py2.py3-none-any.whl.

File metadata

  • Download URL: pytest_simple_settings-0.1.5-py2.py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.9.0

File hashes

Hashes for pytest_simple_settings-0.1.5-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d06c317aaf55a723fa3fdaa0b5e4959062f4f2e9d501376e26c8778e0b3e628d
MD5 970d4116b0c14946e6ef7f218f0a8cbd
BLAKE2b-256 756261a0c29a4467eddead271f5ace2d4f8095b428698600fbc68820570de1fc

See more details on using hashes here.

Supported by

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