(1) a Feature file with no description would cause an error
File "/Users/rcasperson/Library/Caches/pypoetry/virtualenvs/jumpcloud-acceptance-5DpiQ84h-py3.7/bin/sphinx-gherkindoc", line 8, in <module>
sys.exit(main())
File "/Users/rcasperson/Library/Caches/pypoetry/virtualenvs/jumpcloud-acceptance-5DpiQ84h-py3.7/lib/python3.7/site-packages/sphinx_gherkindoc/cli.py", line 278, in main
process_args(args, gherkin_path, output_path, args.doc_project)
File "/Users/rcasperson/Library/Caches/pypoetry/virtualenvs/jumpcloud-acceptance-5DpiQ84h-py3.7/lib/python3.7/site-packages/sphinx_gherkindoc/cli.py", line 127, in process_args
background_step_format=args.background_step_format,
File "/Users/rcasperson/Library/Caches/pypoetry/virtualenvs/jumpcloud-acceptance-5DpiQ84h-py3.7/lib/python3.7/site-packages/sphinx_gherkindoc/writer.py", line 350, in feature_to_rst
steps(feature.background.steps, step_format=background_step_format)
File "/Users/rcasperson/Library/Caches/pypoetry/virtualenvs/jumpcloud-acceptance-5DpiQ84h-py3.7/lib/python3.7/site-packages/sphinx_gherkindoc/parsers/base.py", line 24, in __getattr__
return getattr(self._data, key)
AttributeError: 'NoneType' object has no attribute 'steps'
due to our pytest-bdd parser always returning our custom Background class wrapper even if feature.background == None
(2) A multi-line description via the pytest-bdd parser would fail insphinx-build
Warning, treated as error:
/Users/rcasperson/go/src/github.com/TheJumpCloud/jumpcloud-acceptance/bdd_docs/_docs_working/adbridge.create_user_in_ad.feature-file.rst:21:Inline interpreted text or phrase reference start-string without end-string.
due to a variance in the way pytest-bdd and behave pass descriptions -- where behave returns a list of newline-stripped strings, pytest-bdd returns a single string with newlines embedded. To align this, we can pre-split the description in our pytest_bdd.Feature wrapper class.
These changes have been tested as functional against the private team repo from which @rbcasperson reported the issue, and with them the docs for that repo succesfully build.
Addresses 2 issues reported by @rbcasperson:
(1) a Feature file with no description would cause an error
due to our
pytest-bdd
parser always returning our customBackground
class wrapper even iffeature.background == None
(2) A multi-line description via the
pytest-bdd
parser would fail insphinx-build
due to a variance in the way
pytest-bdd
andbehave
pass descriptions -- wherebehave
returns a list of newline-stripped strings,pytest-bdd
returns a single string with newlines embedded. To align this, we can pre-split the description in ourpytest_bdd.Feature
wrapper class.These changes have been tested as functional against the private team repo from which @rbcasperson reported the issue, and with them the docs for that repo succesfully build.