Remove DeprecationWarning when tests are run from python3