Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Behaviour provides a language suitable for Behaviour Driven Development (BDD), as opposed to post-coding unit testing. It operates as a facade over Python’s unit testing framework.

What is Behaviour Driven Development?

BDD is a derivative of Test Driven Development (TDD), evolving out of the observed adoption-life-cycle for TDD:

  1. A developer starts using a unit testing framework (like unittest.py).

  2. The developer becomes more confident in the quality of his work.

  3. They realize that writing the tests first lets them concentrate on writing the code they needs.

  4. The developer notices that the tests document the code.

  5. Writing tests first helps the developer to design the API for their code.

  6. The developer realizes that TDD is about defining behaviour rather than testing.

  7. The developer adopts mocking as a fundamental approach to support component interactions.

BDD supports the progression through that life-cycle, particularly the last three steps.

BDD supports this transition is by providing an appropriate language. Frameworks for BDD talk about either specifications (e.g., RSpec for Ruby, NSpec for C#.NET) or behaviours (e.g., JBehave for Java, NBehave for .NET).

For more information on BDD, see:

What does Behaviour do for Me?

Behaviour allows you to say things like:

class verifyUserSpecification( behaviour.Behaviour ):

        def setUp( self ):

                self.user = User( "Mark Dancer" )

        def verifyInitialUserNameIsNameInConstructor( self ):

                self.shouldBeEqual( self.user.name, "Mark Dancer" )

        def verifyInitialUserHasNoLanguages( self ):

                self.shouldBeEmpty( self.user.languages )

This has no more expressive power than what is offered by unittest:

class testUser( unittest.TestCase ):

        def setUp( self ):

                self.user = User( "Mark Dancer ")

        def testName( self ):

                self.failUnlessEqual( self.user.name, "Mark Dancer" )

        def testLanguages( self ):

                self.failUnless( self.user.languages = [] )

What it does offer is an alternative set of semantics.

With the semantics of unittest, we are testing a piece of code that we have already written.

With Behaviour, we are writing a specification for the piece of code we are about to write. It is much clearer with BDD that the specification is written before the code.

Metadata

Release files for Behaviour 0.1a4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distributions (sdists)

Source distribution for Behaviour 0.1a4
File Size Uploaded
Behaviour-0.1a4.zip 50.2 kB Details
Behaviour-0.1a4.tar.gz 29.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for Behaviour 0.1a4
File Interpreter ABI Platform
Behaviour-0.1a4-py2.5.egg Legacy Egg format - - Details

Total release size: 125.7 kB

Release files / Behaviour-0.1a4.zip

Download URL Behaviour-0.1a4.zip
Size 50.2 kB
Tags Source
SHA-256 checksum
How to use checksums
995efd251a1f073efd48bbaad53e1cc08411cd1f31e2ffc9c54ae08b892c3bec
BLAKE2b-256 checksum
How to use checksums
35233b5b8116652b4719dc9aa0fabd9b70494578f3de720a8f3682b98d9080e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / Behaviour-0.1a4.tar.gz

Download URL Behaviour-0.1a4.tar.gz
Size 29.4 kB
Tags Source
SHA-256 checksum
How to use checksums
4099f9f7e06f0be554c3fde11000d0e55bd82576cd6cac267eb504032e987eb8
BLAKE2b-256 checksum
How to use checksums
59ed5075dee1e932d7ac493bf85b2e11e5923fb422836aa7730314ab80d1f825
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / Behaviour-0.1a4-py2.5.egg

Download URL Behaviour-0.1a4-py2.5.egg
Size 46.0 kB
Tags Egg
SHA-256 checksum
How to use checksums
4df17b2d18f4afde839d462a4718364b800b68856b7393449982bcc82bbf6d9e
BLAKE2b-256 checksum
How to use checksums
6806b3dc8aebacd67451e056b2f40bdda989d523c0b98864f69942e159b9724c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1a4 This release

3 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page