Skip to main content

Readability Matters

Project description

Baby Steps

PyPI PyPI - Downloads Python Version

BDD steps for test markup. Just for readability.

Usage

from unittest.mock import Mock, call, sentinel

from baby_steps import given, when, then


def test_smth():
    with given:
        value = sentinel.smth
        mock = Mock(return_value=value)

    with when:
        res = mock()

    with then:
        assert res == value
        assert mock.mock_calls == [call()]

Installation

pip3 install baby-steps

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

baby-steps-1.0.1.tar.gz (5.9 kB view hashes)

Uploaded Source

Built Distribution

baby_steps-1.0.1-py3-none-any.whl (6.1 kB view hashes)

Uploaded 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