You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

mockcustomsuite2.py 532B

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