fix tests under py3