errors.py 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. """
  2. Digress errors.
  3. """
  4. class DigressError(Exception):
  5. """
  6. Digress error base class.
  7. """
  8. class NoSuchTestError(DigressError):
  9. """
  10. Raised when no such test exists.
  11. """
  12. class DisabledTestError(DigressError):
  13. """
  14. Test is disabled.
  15. """
  16. class SkippedTestError(DigressError):
  17. """
  18. Test is marked as skipped.
  19. """
  20. class DisabledCaseError(DigressError):
  21. """
  22. Case is marked as disabled.
  23. """
  24. class SkippedCaseError(DigressError):
  25. """
  26. Case is marked as skipped.
  27. """
  28. class FailedTestError(DigressError):
  29. """
  30. Test failed.
  31. """
  32. class ComparisonError(DigressError):
  33. """
  34. Comparison failed.
  35. """
  36. class IncomparableError(DigressError):
  37. """
  38. Values cannot be compared.
  39. """
  40. class AlreadyRunError(DigressError):
  41. """
  42. Test/case has already been run.
  43. """
  44. class SCMError(DigressError):
  45. """
  46. Error occurred in SCM.
  47. """
  48. def __init__(self, message):
  49. self.message = message.replace("\n", " ")
  50. def __str__(self):
  51. return self.message