MCPcopy Index your code
hub / github.com/python/cpython / run_command

Method run_command

Lib/test/test_gc.py:739–748  ·  view source on GitHub ↗
(code)

Source from the content-addressed store, hash-verified

737 gc.set_debug(%s)
738 """
739 def run_command(code):
740 p = subprocess.Popen([sys.executable, "-Wd", "-c", code],
741 stdout=subprocess.PIPE,
742 stderr=subprocess.PIPE)
743 stdout, stderr = p.communicate()
744 p.stdout.close()
745 p.stderr.close()
746 self.assertEqual(p.returncode, 0)
747 self.assertEqual(stdout, b"")
748 return stderr
749
750 stderr = run_command(code % "0")
751 self.assertIn(b"ResourceWarning: gc: 2 uncollectable objects at "

Callers

nothing calls this directly

Calls 3

communicateMethod · 0.95
closeMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected