当前位置: 首页>>代码示例>>Python>>正文


Python support.reap_children函数代码示例

本文整理汇总了Python中test.support.reap_children函数的典型用法代码示例。如果您正苦于以下问题:Python reap_children函数的具体用法?Python reap_children怎么用?Python reap_children使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了reap_children函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_main

def test_main():
    try:
        test.support.run_unittest(
            PydocDocTest, PydocImportTest, TestDescriptions, PydocServerTest, PydocUrlHandlerTest, TestHelper
        )
    finally:
        reap_children()
开发者ID:alfonsodiecko,项目名称:PYTHON_DIST,代码行数:7,代码来源:test_pydoc.py

示例2: test_main

def test_main():
    try:
        support.run_unittest(BasicSignalTests, InterProcessSignalTests,
                             WakeupSignalTests, SiginterruptTest,
                             ItimerTest, WindowsSignalTests)
    finally:
        support.reap_children()
开发者ID:allanbrito,项目名称:my_bash,代码行数:7,代码来源:test_signal.py

示例3: test_main

def test_main():
    support.run_unittest(
        BZ2FileTest,
        BZ2CompressorTest,
        BZ2DecompressorTest,
        FuncTest
    )
    support.reap_children()
开发者ID:LinkedModernismProject,项目名称:web_code,代码行数:8,代码来源:test_bz2.py

示例4: test_main

def test_main():
    try:
        support.run_unittest(PosixTests, InterProcessSignalTests,
                             WakeupFDTests, WakeupSignalTests,
                             SiginterruptTest, ItimerTest, WindowsSignalTests,
                             PendingSignalsTests)
    finally:
        support.reap_children()
开发者ID:BrythonServer,项目名称:brython,代码行数:8,代码来源:test_signal.py

示例5: test_main

def test_main():
    support.run_unittest(
        BZ2FileTest,
        BZ2CompressorTest,
        BZ2DecompressorTest,
        CompressDecompressTest,
        OpenTest,
    )
    support.reap_children()
开发者ID:timm,项目名称:timmnix,代码行数:9,代码来源:test_bz2.py

示例6: tearDown

    def tearDown(self):
        signal_alarm(0)  # Didn't deadlock.
        reap_children()

        for fn in self.test_files:
            try:
                os.remove(fn)
            except os.error:
                pass
        self.test_files[:] = []
开发者ID:ChowZenki,项目名称:kbengine,代码行数:10,代码来源:test_socketserver.py

示例7: test_main

def test_main():
    try:
        start_dir = os.path.dirname(__file__)
        top_dir = os.path.dirname(os.path.dirname(start_dir))
        test_loader = unittest.TestLoader()
        # XXX find out how to use unittest.main, to get command-line options
        # (failfast, catch, etc.)
        run_unittest(test_loader.discover(start_dir, top_level_dir=top_dir))
    finally:
        reap_children()
开发者ID:Naddiseo,项目名称:cpython,代码行数:10,代码来源:__main__.py

示例8: run_pydoc

def run_pydoc(module_name, *args):
    """
    Runs pydoc on the specified module. Returns the stripped
    output of pydoc.
    """
    cmd = [sys.executable, pydoc.__file__, " ".join(args), module_name]
    try:
        output = subprocess.Popen(cmd, stdout=subprocess.PIPE).communicate()[0]
        return output.strip()
    finally:
        reap_children()
开发者ID:edmundgentle,项目名称:schoolscript,代码行数:11,代码来源:test_pydoc.py

示例9: test_main

def test_main():
    unit_tests = (ProcessTestCase,
                  POSIXProcessTestCase,
                  Win32ProcessTestCase,
                  ProcessTestCasePOSIXPurePython,
                  CommandTests,
                  ProcessTestCaseNoPoll,
                  HelperFunctionTests,
                  CommandsWithSpaces)

    support.run_unittest(*unit_tests)
    support.reap_children()
开发者ID:vladistan,项目名称:py3k-__format__-sprint,代码行数:12,代码来源:test_subprocess.py

示例10: tearDown

 def tearDown(self):
     for inst in popen2._active:
         inst.wait()
     popen2._cleanup()
     self.assertFalse(popen2._active, "popen2._active not empty")
     # The os.popen*() API delegates to the subprocess module (on Unix)
     import subprocess
     for inst in subprocess._active:
         inst.wait()
     subprocess._cleanup()
     self.assertFalse(subprocess._active, "subprocess._active not empty")
     reap_children()
开发者ID:isaiah,项目名称:jython3,代码行数:12,代码来源:test_popen2.py

示例11: tearDown

    def tearDown(self):
        self.unpatch_get_running_loop()

        events.set_event_loop(None)

        # Detect CPython bug #23353: ensure that yield/yield-from is not used
        # in an except block of a generator
        self.assertEqual(sys.exc_info(), (None, None, None))

        self.doCleanups()
        support.threading_cleanup(*self._thread_cleanup)
        support.reap_children()
开发者ID:asvetlov,项目名称:cpython,代码行数:12,代码来源:test_utils.py

示例12: test_main

def test_main():
    try:
        test.support.run_unittest(PydocDocTest,
                                  PydocImportTest,
                                  TestDescriptions,
                                  PydocServerTest,
                                  PydocUrlHandlerTest,
                                  TestHelper,
                                  PydocWithMetaClasses,
                                  TestInternalUtilities,
                                  )
    finally:
        reap_children()
开发者ID:CCNITSilchar,项目名称:cpython,代码行数:13,代码来源:test_pydoc.py

示例13: test_popen

 def test_popen(self):
     self.assertRaises(TypeError, os.popen)
     self._do_test_commandline(
         "foo bar",
         ["foo", "bar"]
     )
     self._do_test_commandline(
         'foo "spam and eggs" "silly walk"',
         ["foo", "spam and eggs", "silly walk"]
     )
     self._do_test_commandline(
         'foo "a \\"quoted\\" arg" bar',
         ["foo", 'a "quoted" arg', "bar"]
     )
     support.reap_children()
开发者ID:Connor124,项目名称:Gran-Theft-Crop-Toe,代码行数:15,代码来源:test_popen.py

示例14: test_reap_children

    def test_reap_children(self):
        # Make sure that there is no other pending child process
        support.reap_children()

        # Create a child process
        pid = os.fork()
        if pid == 0:
            # child process: do nothing, just exit
            os._exit(0)

        t0 = time.monotonic()
        deadline = time.monotonic() + 60.0

        was_altered = support.environment_altered
        try:
            support.environment_altered = False
            stderr = io.StringIO()

            while True:
                if time.monotonic() > deadline:
                    self.fail("timeout")

                with contextlib.redirect_stderr(stderr):
                    support.reap_children()

                # Use environment_altered to check if reap_children() found
                # the child process
                if support.environment_altered:
                    break

                # loop until the child process completed
                time.sleep(0.100)

            msg = "Warning -- reap_children() reaped child process %s" % pid
            self.assertIn(msg, stderr.getvalue())
            self.assertTrue(support.environment_altered)
        finally:
            support.environment_altered = was_altered

        # Just in case, check again that there is no other
        # pending child process
        support.reap_children()
开发者ID:CCNITSilchar,项目名称:cpython,代码行数:42,代码来源:test_support.py

示例15: test_main

def test_main():
    support.run_unittest(ProcessTestCase, CommandTests)
    support.reap_children()
开发者ID:LinkedModernismProject,项目名称:web_code,代码行数:3,代码来源:test_subprocess.py


注:本文中的test.support.reap_children函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。