def __exit__(self, exc_type, exc_value, traceback):
        if not self._fail and not self.valid:
            _logger.warning("Condition:%s: NOT VALID at __exit__.", self.name)

        if ec.is_standalone():
            if exc_type is None and not self._valid:
                raise AssertionError("Condition:{}: NOT VALID.".format(
                    self.name))
 def __exit__(self, exc_type, exc_value, traceback):
     if not self._fail and not self.valid:
         _logger.warning("Condition:%s: NOT VALID.", self.name)
         
     # Force a non-zero return code in standalone
     # if a condition did not become valid
     global _STANDALONE_FAILED
     if ec.is_standalone() and not _STANDALONE_FAILED:
         if exc_type is None and not self._valid:
             raise AssertionError("Condition:{}: NOT VALID.".format(self.name))
Esempio n. 3
0
    def fail(self):
        """Fail the condition.

        Marks the condition as failed. Once a condition has failed it
        can never become valid, the test that uses the condition will fail.
        """
        self._metric_fail.value = 1
        self.valid = False
        self._fail = True
        if (ec.is_standalone()):
            raise AssertionError("Condition failed:" + str(self))
Esempio n. 4
0
    def __exit__(self, exc_type, exc_value, traceback):
        if not self._fail and not self.valid:
            _logger.warning("Condition:%s: NOT VALID.", self.name)

        # Force a non-zero return code in standalone
        # if a condition did not become valid
        global _STANDALONE_FAILED
        if ec.is_standalone() and not _STANDALONE_FAILED:
            if exc_type is None and not self._valid:
                raise AssertionError("Condition:{}: NOT VALID.".format(
                    self.name))
    def fail(self):
        """Fail the condition.

        Marks the condition as failed. Once a condition has failed it
        can never become valid, the test that uses the condition will fail.
        """
        if not self._fail:
            _logger.error("Condition:%s: FAILED", self.name)
        self._metric_fail.value = 1
        self.valid = False
        self._fail = True
        if (ec.is_standalone()):
            raise AssertionError("Condition:{}: FAILED".format(self.name))
    def fail(self):
        """Fail the condition.

        Marks the condition as failed. Once a condition has failed it
        can never become valid, the test that uses the condition will fail.
        """
        if not self._fail:
            _logger.error("Condition:%s: FAILED", self.name)
        self._metric_fail.value = 1
        self.valid = False
        self._fail = True
        if (ec.is_standalone()):
            global _STANDALONE_FAILED
            _STANDALONE_FAILED = True
            raise AssertionError("Condition:{}: FAILED".format(self.name))
Esempio n. 7
0
 def __exit__(self, exc_type, exc_value, traceback):
     if (ec.is_standalone()):
         if not self._fail and not self.valid:
             raise AssertionError("Condition failed:" + str(self))
Esempio n. 8
0
 def fail(self):
     self._metric_fail.value = 1
     self.valid = False
     self._fail = True
     if (ec.is_standalone()):
         raise AssertionError("Condition failed:" + str(self))