Skip to main content

A nose plugin that supports writing describe/it styleunit tests with nested contexts

Project description

A nose plugin for describe/it syntax

Installing it

$ pip install describe-it

Writing a test

Any module that ends with ‘spec’ is considered to contain specifications/tests for describe_it.

$ vim myfirst_spec.py

…and the content:

from game import Game
from describe_it import describe, it, before_each, Fixture

@describe
def a_game():
    f = Fixture()

    @before_each
    def setup():
        f.game = Game()

    @it
    def is_player_ones_turn():
        assert f.game.current_player == 1

    @describe
    def in_second_round():

        @before_each
        def setup():
            f.game.play_round()

        @it
        def is_player_twos_turn():
            assert f.game.current_player == 2

Running tests

$ nosetests --with-describe-it

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

describe_it-0.1.5.tar.gz (3.3 kB view hashes)

Uploaded Source

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