-
由 Cleber Rosa 提交于
The AssertionError exception is intended to be used when an internal condition that must exist, does not exist. When dealing with values received from an outer layer, that we can't control, it's better to use the more appropriate ValueError. Another reason is that code such as: def run_avocado(self): self._setup_environment_variables() try: self._tag_start() self._run_avocado() ... except AssertionError as detail: self.__status = 'FAIL' self.__fail_class = detail.__class__.__name__ self.__fail_reason = str(detail) self.__traceback = stacktrace.prepare_exc_info(sys.exc_info()) ... Can be afected by the AssertionErrors, and return a test failure instead of a test error. Reference: https://docs.python.org/3/library/exceptions.html#ValueError Reference: https://docs.python.org/3/library/exceptions.html#AssertionErrorSigned-off-by: NCleber Rosa <crosa@redhat.com>
a281534d