Example #1
0
 def _fake_execute(self, argv):
     prev_argv = list(sys.argv)
     sys.argv = argv[:]
     try:
         main_entry_point()
     finally:
         sys.argv = prev_argv
Example #2
0
 def _fake_execute(self, argv):
     prev_argv = list(sys.argv)
     sys.argv = argv[:]
     try:
         main_entry_point()
     finally:
         sys.argv = prev_argv
Example #3
0
    def test_interspersed_positional_arguments(self):

        self.forge.replace_with(slash_run, "_collect_tests", self._collect_tests_stub)
        self.forge.replace_with(sys, "argv", "/path/to/slash run -vv test1.py -x test2.py --pdb".split())
        with self.assertRaises(SystemExit) as caught:
            main_entry_point()
        self.assertTrue(self.callback_success)
        if isinstance(caught.exception, int):
            # python 2.6
            code = caught.exception
        else:
            code = caught.exception.code
        self.assertEquals(code, 0)
Example #4
0
    def test_interspersed_positional_arguments(self):

        self.forge.replace_with(slash_run, "_collect_tests",
                                self._collect_tests_stub)
        self.forge.replace_with(
            sys, "argv",
            "/path/to/slash run -vv test1.py -x test2.py --pdb".split())
        with self.assertRaises(SystemExit) as caught:
            main_entry_point()
        self.assertTrue(self.callback_success)
        if isinstance(caught.exception, int):
            # python 2.6
            code = caught.exception
        else:
            code = caught.exception.code
        self.assertEquals(code, 0)