Skip to content

Conversation

JoseALermaIII
Copy link
Owner

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 running ls -R file_path before doing a rm -rf file_path, except far less dangerous.

CheckExternalLinksBuilder uses requests 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

@JoseALermaIII JoseALermaIII self-assigned this Oct 2, 2019
@JoseALermaIII JoseALermaIII added the enhancement New feature or request label Oct 2, 2019
@JoseALermaIII
Copy link
Owner Author

Veni, vidi, tentāvī

@JoseALermaIII JoseALermaIII merged commit 42e525c into master Oct 3, 2019
@JoseALermaIII JoseALermaIII deleted the add-sphinx-tests branch October 3, 2019 00:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant