[PATCH v2 18/41] test/py: Raise a ValueError if a command fails