Our tests currently import test_with_with into test_testcase so that
we could still run tests on python2.5. Since we no longer support
2.5, we don't need this hack. Its a hack because discovery will
import test_with_with directly itself, and thus we triggered
a duplicate test id error when attempting to use discover on the
testtools test base.
Change-Id: I027929ab4b0df350dd18ab01ffd5c493fe35e101
test_testcase,
test_testresult,
test_testsuite,
+ test_with_with,
)
modules = [
matchers,
test_testcase,
test_testresult,
test_testsuite,
+ test_with_with,
]
suites = map(lambda x: x.test_suite(), modules)
return TestSuite(suites)
FullStackRunTest,
LoggingResult,
)
-try:
- exec('from __future__ import with_statement')
-except SyntaxError:
- pass
-else:
- from testtools.tests.test_with_with import *
class TestPlaceHolder(TestCase):
pass
exc = self.assertRaises(AssertionError, die)
self.assertThat(exc.args[0], EndsWith(': foo'))
+
+
+def test_suite():
+ from unittest import TestLoader
+ return TestLoader().loadTestsFromName(__name__)