Improve testing in py3 environment

Change-Id: I1d169f0a87d4251778b32e80b3627b407340fec8