__init__.py 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. # Copyright (c) Twisted Matrix Laboratories.
  2. # See LICENSE for details.
  3. #
  4. # Maintainer: Jonathan Lange
  5. """
  6. Twisted Trial: Asynchronous unit testing framework.
  7. Trial extends Python's builtin C{unittest} to provide support for asynchronous
  8. tests.
  9. Trial strives to be compatible with other Python xUnit testing frameworks.
  10. "Compatibility" is a difficult things to define. In practice, it means that:
  11. - L{twisted.trial.unittest.TestCase} objects should be able to be used by
  12. other test runners without those runners requiring special support for
  13. Trial tests.
  14. - Tests that subclass the standard library C{TestCase} and don't do anything
  15. "too weird" should be able to be discoverable and runnable by the Trial
  16. test runner without the authors of those tests having to jump through
  17. hoops.
  18. - Tests that implement the interface provided by the standard library
  19. C{TestCase} should be runnable by the Trial runner.
  20. - The Trial test runner and Trial L{unittest.TestCase} objects ought to be
  21. able to use standard library C{TestResult} objects, and third party
  22. C{TestResult} objects based on the standard library.
  23. This list is not necessarily exhaustive -- compatibility is hard to define.
  24. Contributors who discover more helpful ways of defining compatibility are
  25. encouraged to update this document.
  26. Examples:
  27. B{Timeouts} for tests should be implemented in the runner. If this is done,
  28. then timeouts could work for third-party TestCase objects as well as for
  29. L{twisted.trial.unittest.TestCase} objects. Further, Twisted C{TestCase}
  30. objects will run in other runners without timing out.
  31. See U{http://twistedmatrix.com/trac/ticket/2675}.
  32. Running tests in a temporary directory should be a feature of the test case,
  33. because often tests themselves rely on this behaviour. If the feature is
  34. implemented in the runner, then tests will change behaviour (possibly
  35. breaking) when run in a different test runner. Further, many tests don't even
  36. care about the filesystem.
  37. See U{http://twistedmatrix.com/trac/ticket/2916}.
  38. """