A sphinx extension for behave to auto document.
Setup
To add auto behave to your sphinx modify conf.py by adding auto behave to extensions like so:
extensions = ['..', '..', 'auto_behave']
To enable auto behave’s rst generation modify conf.py 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
features
├── environment.py
├── order.feature
│
└── steps
├── add.py
└── remove.py
Custom Folder Structure
features
├── environment.py
├── order
| ├── create_order.feature
│ └── steps
| ├── add.py
| └── remove.py
|
└── steps
├── __init__.py
├── navigation.py
└── common.py
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 __init__.py and import all other steps files that are not in this directory i.e.
# features/steps/__init__.py
import features.order.steps.add
import features.order.steps.remove
Usage
You can of course create your own rst for more manual approach by using autobehave directive, like so:
Order Steps
===========
.. autobehave::
features.order.steps.add
features.order.steps.remove
Release files for auto-behave 0.0.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| auto_behave-0.0.7.tar.gz | 5.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| auto_behave-0.0.7-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.2 kB
Release files / auto_behave-0.0.7.tar.gz
| Download URL | auto_behave-0.0.7.tar.gz |
|---|---|
| Size | 5.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
28a38a5e0082a78659c9eaad0f3da67995544a30bbf8f997b2ff9eb3ac718783
|
|
BLAKE2b-256 checksum How to use checksums |
c3b29871c8492b0e457cea84e767e1d89efd70014a078e4d8e263c84aa44c582
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.6.9
|
Release files / auto_behave-0.0.7-py3-none-any.whl
| Download URL | auto_behave-0.0.7-py3-none-any.whl |
|---|---|
| Size | 8.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
41313ef3692654d231ed769288506bbde8e12174101b2dbf942878ea9a640ea6
|
|
BLAKE2b-256 checksum How to use checksums |
c7dd85d1e7122c886bf0e641ce01abe2a8bc95a5831257ee77e257762bfecb8b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.6.9
|