def test_namespace_pkg(self): """Ensure namespace packages work/can import from each other""" stream = StringIO() runner = TestRunner(stream=stream) runner.verbosity = 2 prog = TestProgram(argv=[''], testRunner=runner, exit=False) res = runner.result self.assertEqual(res.testsRun, 1, "Expected to run 1 test, ran %s" % res.testsRun) assert res.wasSuccessful() assert not res.errors assert not res.failures
def test_traverse_namespace(self): """Ensure the --traverse-namespace option tests the other namespace package sibling also. """ stream = StringIO() runner = TestRunner(stream=stream) runner.verbosity = 2 prog = TestProgram(argv=['', '--traverse-namespace'], testRunner=runner, exit=False) res = runner.result self.assertEqual(res.testsRun, 2, "Expected to run 2 tests, ran %s" % res.testsRun) assert res.wasSuccessful() assert not res.errors assert not res.failures
def test_run_support_ctx(self): """Collect and run tests in functional_tests/support/ctx This should collect no tests in the default configuration, since none of the modules have test-like names. """ stream = StringIO() runner = TestRunner(stream=stream) runner.verbosity = 2 prog = TestProgram(argv=[''], testRunner=runner, exit=False) res = runner.result self.assertEqual(res.testsRun, 2, "Expected to run 2 tests, ran %s" % res.testsRun) assert res.wasSuccessful() assert not res.errors assert not res.failures