Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

pypm install pyhistorian

How to install pyhistorian

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install pyhistorian
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
0.6.8 Available View build log
Windows (64-bit)
0.6.8 Available View build log
Mac OS X (10.5+)
0.6.8 Available View build log
Linux (32-bit)
0.6.8 Available View build log
Linux (64-bit)
0.6.8 Available View build log
MIT License
Depended by
Lastest release
version 0.6.8 on Jan 5th, 2011

The goal of pyhistorian is to write an internal Given-When-Then template using Python. The ideas came from JBehave, RBehave, Cucumber and others.

It's possible to write your stories in English and Portuguese, choose your preferred.

A good example of use [en-us, by default] follows (call this file calculator.py):

System Message: WARNING/2 (<string>, line 11)

Literal block expected; none found.

from should_dsl import * from pyhistorian import *

class Calculator(object): def sum(self, n1, n2): return n1+n2

class SpecifyingMyNewCalculator(Story): """As a lazy mathematician I want to use a calculator So that I don't waste my time thinking""" colored = True template_color = 'yellow' scenarios = ['SumScenario'] # optional

class SumScenario(Scenario): @Given('I have a calculator') def set_my_calculator(self): self.calculator = Calculator()

@When('I enter with 1 + 1') def sum_one_to_one(self): self.result = self.calculator.sum(1, 1)

@Then('I have $value as result', 2) def get_result(self, value): self.result |should_be| value

if __name__ == '__main__': SpecifyingMyNewCalculator.run()


$ python calculator.py

System Message: ERROR/3 (<string>, line 48)

Inconsistent literal block quoting.

Story: Specifying my new calculator As a lazy mathematician I want to use a calculator So that I don't waste my time thinking

Scenario 1: Sum of 1 and 1 Given I have a calculator ... OK When I enter with 1 + 1 ... OK Then I have 2 as result ... OK

Ran 1 scenarios with 0 failures, 0 errors and 0 pending steps

pyhistorian is at github.com

Due to DVCS I moved pyhistorian from Google Gode to github.com.

You can get it at here:


Docutils System Messages

System Message: ERROR/3 (<string>, line 37); backlink

Undefined substitution referenced: "should_be".

Subscribe to package updates

Last updated Jan 5th, 2011

Download Stats

Last month:1

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.