MCPcopy Index your code
hub / github.com/RustPython/RustPython / run_command

Method run_command

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

Source from the content-addressed store, hash-verified

741 gc.set_debug(%s)
742 """
743 def run_command(code):
744 p = subprocess.Popen([sys.executable, "-Wd", "-c", code],
745 stdout=subprocess.PIPE,
746 stderr=subprocess.PIPE)
747 stdout, stderr = p.communicate()
748 p.stdout.close()
749 p.stderr.close()
750 self.assertEqual(p.returncode, 0)
751 self.assertEqual(stdout, b"")
752 return stderr
753
754 stderr = run_command(code % "0")
755 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