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

Method test_repr

Lib/test/test_subprocess.py:1657–1672  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1655 p.communicate(b"x" * 2**20)
1656
1657 def test_repr(self):
1658 cases = [
1659 ("ls", True, 123, "<Popen: returncode: 123 args: 'ls'>"),
1660 ('a' * 100, True, 0,
1661 "<Popen: returncode: 0 args: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...>"),
1662 (["ls"], False, None, "<Popen: returncode: None args: ['ls']>"),
1663 (["ls", '--my-opts', 'a' * 100], False, None,
1664 "<Popen: returncode: None args: ['ls', '--my-opts', 'aaaaaaaaaaaaaaaaaaaaaaaa...>"),
1665 (os_helper.FakePath("my-tool.py"), False, 7,
1666 "<Popen: returncode: 7 args: <FakePath 'my-tool.py'>>")
1667 ]
1668 with unittest.mock.patch.object(subprocess.Popen, '_execute_child'):
1669 for cmd, shell, code, sx in cases:
1670 p = subprocess.Popen(cmd, shell=shell)
1671 p.returncode = code
1672 self.assertEqual(repr(p), sx)
1673
1674 def test_communicate_epipe_only_stdin(self):
1675 # Issue 10963: communicate() should hide EPIPE

Callers

nothing calls this directly

Calls 2

reprFunction · 0.85
assertEqualMethod · 0.45

Tested by

no test coverage detected