mockcustomsuite.py 535 B

123456789101112131415161718192021
  1. # Copyright (c) 2006 Twisted Matrix Laboratories. See LICENSE for details
  2. """
  3. Mock test module that contains a C{test_suite} method. L{runner.TestLoader}
  4. should load the tests from the C{test_suite}, not from the C{Foo} C{TestCase}.
  5. See {twisted.trial.test.test_loader.LoaderTest.test_loadModuleWith_test_suite}.
  6. """
  7. from twisted.trial import unittest, runner
  8. class Foo(unittest.SynchronousTestCase):
  9. def test_foo(self):
  10. pass
  11. def test_suite():
  12. ts = runner.TestSuite()
  13. ts.name = "MyCustomSuite"
  14. return ts