test_test_loader.py 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. # testresources: extensions to python unittest to allow declaritive use
  2. # of resources by test cases.
  3. #
  4. # Copyright (c) 2005-2010 Testresources Contributors
  5. #
  6. # Licensed under either the Apache License, Version 2.0 or the BSD 3-clause
  7. # license at the users choice. A copy of both licenses are available in the
  8. # project source as Apache-2.0 and BSD. You may not use this file except in
  9. # compliance with one of these two licences.
  10. #
  11. # Unless required by applicable law or agreed to in writing, software distributed
  12. # under these licenses is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
  13. # CONDITIONS OF ANY KIND, either express or implied. See the license you chose
  14. # for the specific language governing permissions and limitations under that
  15. # license.
  16. #
  17. import testtools
  18. from testresources import TestLoader, OptimisingTestSuite
  19. from testresources.tests import TestUtil
  20. def test_suite():
  21. loader = TestUtil.TestLoader()
  22. result = loader.loadTestsFromName(__name__)
  23. return result
  24. class TestTestLoader(testtools.TestCase):
  25. def testSuiteType(self):
  26. # The testresources TestLoader loads tests into an
  27. # OptimisingTestSuite.
  28. loader = TestLoader()
  29. suite = loader.loadTestsFromName(__name__)
  30. self.assertIsInstance(suite, OptimisingTestSuite)