A nose plugin that supports writing describe/it style unit tests with nested contexts
Project description
Installing
$ pip install describe-it
Writing
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()
@after_each
def teardown():
# This should rarely be needed!
perform_post_test_cleanup_if_needed()
@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
$ nosetests --with-describe-it
Project details
Release history Release notifications | RSS feed
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-1.0.0.tar.gz
(3.6 kB
view hashes)