Make `setup.py test -t` option work for .rst files

This was mentioned in #2048.