Add sphinx test

Adds a test that the Sphinx build succeeds (0 exit status) and has no warnings or errors in the stdout or stderr.

1575808 has been cherry-picked into this branch from another PR so that the new test passes.
This is a bit "stuttery" for my liking. How about

```python
warnings = [w for w in warnings if any(w in aw for aw in allowed_warnings)]
```