MCPcopy
hub / github.com/pex-tool/pex / test_execute_repl

Function test_execute_repl

tests/test_pex.py:840–864  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

838
839
840def test_execute_repl():
841 with temporary_dir() as pex_chroot:
842 pex_builder = PEXBuilder(path=pex_chroot)
843 pex_builder.freeze()
844 process = PEX(pex_chroot).run(
845 args=[],
846 stdout=subprocess.PIPE,
847 stderr=subprocess.PIPE,
848 stdin=subprocess.PIPE,
849 blocking=False,
850 )
851 commands = dedent(
852 """
853 assert False
854 20 + 103
855 quit()
856 """
857 )
858 stdout, stderr = process.communicate(input=commands.encode("utf-8"))
859
860 assert stderr.startswith(EXPECTED_REPL_BANNER_NO_DEPS), stderr
861 assert b"AssertionError" in stderr
862 assert b">>> " in stdout
863 assert b"123" in stdout
864 assert 0 == process.returncode
865
866
867def test_execute_repl_with_python_options():

Callers

nothing calls this directly

Calls 7

freezeMethod · 0.95
temporary_dirFunction · 0.90
PEXBuilderClass · 0.90
PEXClass · 0.90
communicateMethod · 0.80
runMethod · 0.45
encodeMethod · 0.45

Tested by

no test coverage detected