Skip to main content

A plugin for nose2 implementing behavior-driven testing.

Project description

A plugin for running behavior-driven tests using gherkin inside nose2.


To enable planterbox for your project, you’ll want to add the following lines (or similar) to your unittest.cfg:

plugins = planterbox

always-on = True

planterbox is compatible with

Writing Tests

planterbox tests exist inside a python package which provides a context for their execution. You should write your tests in .feature files in the package directory. .feature files have access to all steps defined in or imported into their package’s For example, with the directory structure:


If contains:

from planterbox import step

@step(r'I add (\d+) and (\d+)')
def add(test, a, b):
    a = int(a)
    b = int(b)
    test.result = a + b

@step(r'the result should be (\d+)')
def check_result(test, value):
    value = int(value)
    test.assertEqual(test.result, value)

basic.feature could contain:

Feature: Basic Tests
    I want to exercise generation of a simple test from a feature.

    Scenario: I need to verify basic arithmetic.
        Given I add 1 and 1
        Then the result should be 2

We could then run this test either by running all of the tests in the suite with nose2 or run it specifically with nose2 planterbox.tests.test_feature:basic.feature. We could even run the first scenario specifically with nose2 planterbox.tests.test_feature:basic.feature:0.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for planterbox, version 0.5
Filename, size File type Python version Upload date Hashes
Filename, size planterbox-0.5-py2-none-any.whl (11.5 kB) File type Wheel Python version 2.7 Upload date Hashes View
Filename, size planterbox-0.5.tar.gz (9.8 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page