jolly-good-toolbelt / sphinx_gherkindoc

A tool to convert Gherkin into Sphinx documentation
https://jolly-good-toolbelt.github.io/sphinx_gherkindoc/
11 stars 10 forks source link

When using `--integrate-background`, every feature currently must have a background #15

Closed rbcasperson closed 5 years ago

rbcasperson commented 5 years ago

While using this flag, I just now came across a feature that does not have a Background section, and I get the following error:

  File "/usr/local/lib/python3.7/site-packages/sphinx_gherkindoc/writer.py", line 254, in feature_to_rst
    steps(feature.background.steps, step_format=background_step_format)
AttributeError: 'NoneType' object has no attribute 'steps'

Just needs a little tweak to only try to add the background steps if a background exists.