Use pexpect in Python3 test