Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: simplify doctest execution #78

Open
tiborsimko opened this issue Mar 14, 2017 · 0 comments
Open

tests: simplify doctest execution #78

tiborsimko opened this issue Mar 14, 2017 · 0 comments

Comments

@tiborsimko
Copy link
Member

The following cookiecutter change:

inveniosoftware/cookiecutter-invenio-module#98

should be propagated to this Invenio module.

Namely, in run-tests.sh, the sphinx for doctests is invoked after pytest run:

$ tail -3 ./\{\{\ cookiecutter.project_shortname\ \}\}/run-tests.sh
sphinx-build -qnNW docs docs/_build/html && python setup.py test && sphinx-build -qnNW -b doctest docs docs/_build/doctest

This sometimes led to problems on Travis CI with the second sphinx-build run due
to "disappearing" dependencies after the example application was tested.

A solution that worked for invenio-marc21 (see
inveniosoftware/invenio-marc21#49 (comment))
and that was integrated in cookiecutter (see
inveniosoftware/cookiecutter-invenio-module#98) was to
run doctest execution in pytest, removing the second sphinx-build invocation.

This both solved Travis CI build failures and simplified test suite execution.

Note that this change may necessitate to amend the code tests etc so that things
would be executed with the Flask application context (see
inveniosoftware/invenio-marc21@09e98fc).

@tiborsimko tiborsimko added this to the v1.0.0 milestone Mar 14, 2017
hjhsalo added a commit to hjhsalo/invenio-collections that referenced this issue Mar 28, 2017
* doctests are now executed with pytest instead of sphinx.
  ( closes inveniosoftware#78 )

* added missing copyright information

Signed-off-by: Harri Hirvonsalo <[email protected]>
@hjhsalo hjhsalo self-assigned this Mar 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants