twisted_trial.py 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. from __future__ import division, absolute_import
  2. from zope.interface import implementer
  3. from twisted.trial.itrial import IReporter
  4. from twisted.plugin import IPlugin
  5. @implementer(IPlugin, IReporter)
  6. class _Reporter(object):
  7. def __init__(self, name, module, description, longOpt, shortOpt, klass):
  8. self.name = name
  9. self.module = module
  10. self.description = description
  11. self.longOpt = longOpt
  12. self.shortOpt = shortOpt
  13. self.klass = klass
  14. Tree = _Reporter("Tree Reporter",
  15. "twisted.trial.reporter",
  16. description="verbose color output (default reporter)",
  17. longOpt="verbose",
  18. shortOpt="v",
  19. klass="TreeReporter")
  20. BlackAndWhite = _Reporter("Black-And-White Reporter",
  21. "twisted.trial.reporter",
  22. description="Colorless verbose output",
  23. longOpt="bwverbose",
  24. shortOpt="o",
  25. klass="VerboseTextReporter")
  26. Minimal = _Reporter("Minimal Reporter",
  27. "twisted.trial.reporter",
  28. description="minimal summary output",
  29. longOpt="summary",
  30. shortOpt="s",
  31. klass="MinimalReporter")
  32. Classic = _Reporter("Classic Reporter",
  33. "twisted.trial.reporter",
  34. description="terse text output",
  35. longOpt="text",
  36. shortOpt="t",
  37. klass="TextReporter")
  38. Timing = _Reporter("Timing Reporter",
  39. "twisted.trial.reporter",
  40. description="Timing output",
  41. longOpt="timing",
  42. shortOpt=None,
  43. klass="TimingTextReporter")
  44. Subunit = _Reporter("Subunit Reporter",
  45. "twisted.trial.reporter",
  46. description="subunit output",
  47. longOpt="subunit",
  48. shortOpt=None,
  49. klass="SubunitReporter")