Add sphinx tests to tox and travis ci #9
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Add tests for sphinx docs to
tox
and Travis CI.Description
At first, I thought there was no way to test sphinx docs aside from manually checking each generated page.
Upon further digging, I discovered the devs at Sphinx have provided some handy Sphinx builders. Among them are DummyBuilder and CheckExternalLinksBuilder.
Contrary to its name,
DummyBuilder
is smart enough to build the Sphinx docs without generating output. Kind of like runningls -R file_path
before doing arm -rf file_path
, except far less dangerous.CheckExternalLinksBuilder
usesrequests
to fetch headers to confirm if a URL exists. Pretty smart! The only downside I can foresee is that is also checks the URL of the Travis CI and Coveralls badges. During high-volume periods, these badges can be unavailable and may cause the tests to fail.Testing is good; test all the things.
At some point, I'll do more input tests for the previous modules, like I did in
tests/test_chapter01
. The problem with input tests is that error strings that are constants should be grouped together to test their values. Talk about test-ception.Team Notifications
Me, myself, and I