Пример #1
0
 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
Пример #2
0
 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
Пример #3
0
 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
Пример #4
0
    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