fix unittest deprecation warnings under python 3.4

I got deprecation warnings when running `python3 -m unittest discover`. The tests appear to pass with both python3 and python2.