skip to navigation
skip to content

Not Logged In

describe_it 0.1.3

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

Latest Version: 2.1.0

A nose plugin for describe/it syntax

Installing it:

pip install describe-it

Writing a test:

>vim myfirst_spec.py

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

At the moment only files ending with ‘spec.py’ are considered to contain tests for describe/it (this will probably change).

 
File Type Py Version Uploaded on Size
describe_it-0.1.3.tar.gz (md5) Source 2014-07-15 3KB
  • Downloads (All Versions):
  • 31 downloads in the last day
  • 282 downloads in the last week
  • 924 downloads in the last month
  • Author: Joakim Karlsson
  • Home Page: https://github.com/joakimkarlsson/describe_it
  • Keywords: unit testing,tdd,bdd,nose
  • License:
    The MIT License (MIT)
    
    Copyright (c) <year> <copyright holders>
    
    Permission is hereby granted, free of charge, to any person obtaining a copy
    of this software and associated documentation files (the "Software"), to deal
    in the Software without restriction, including without limitation the rights
    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    copies of the Software, and to permit persons to whom the Software is
    furnished to do so, subject to the following conditions:
    
    The above copyright notice and this permission notice shall be included in
    all copies or substantial portions of the Software.
    
    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
    THE SOFTWARE.
  • Package Index Owner: jhkarlsson
  • DOAP record: describe_it-0.1.3.xml