Work around problem in doctest discovery in Python 3.4 with PyQt

Closes gh-4892
Merge pull request #4972 from takluyver/py34-qt-doctest-fix

Work around problem in doctest discovery in Python 3.4 with PyQt