Make test for deprecation warnings work with Python 3.