Skip to main content

A sphinx extension for behave to auto document

Project description

A sphinx extension for behave to auto document.


To add auto behave to your sphinx modify by adding auto behave to extensions like so:

extensions = ['..', '..', 'auto_behave']

To enable auto behave’s rst generation modify by adding the following to the bottom:

from auto_behave.gen_step_rst import generate_step_rst_files
generate_step_rst_files('abs/path/to/project', 'rel/path/features/dir', 'rel/path/doc/features')

File Layout

Auto behave’s rst generation supports both the standard behave & more custom folder structure layouts.

Standard Behave

├── order.feature
└── steps

Custom Folder Structure

├── order
|   ├── create_order.feature
│   └── steps
|       ├──
|       └──
└── steps

By default behave doesn’t allow you to have step files in different directories outside a single step folder. Being locked to single folder becomes a problem with a large scale project. To get around behave’s limitation within behave’s step directory i.e. features/steps create and import all other steps files that are not in this directory i.e.

# features/steps/

import features.order.steps.add
import features.order.steps.remove


You can of course create your own rst for more manual approach by using autobehave directive, like so:

Order Steps

..  autobehave::


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 auto-behave, version 0.0.7
Filename, size File type Python version Upload date Hashes
Filename, size auto_behave-0.0.7-py3-none-any.whl (8.5 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size auto_behave-0.0.7.tar.gz (5.7 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page