()
| 865 | |
| 866 | |
| 867 | def test_execute_repl_with_python_options(): |
| 868 | with temporary_dir() as pex_chroot: |
| 869 | pex_builder = PEXBuilder(path=pex_chroot) |
| 870 | pex_builder.freeze() |
| 871 | process = PEX(pex_chroot).run( |
| 872 | args=["-O"], |
| 873 | stdout=subprocess.PIPE, |
| 874 | stderr=subprocess.PIPE, |
| 875 | stdin=subprocess.PIPE, |
| 876 | blocking=False, |
| 877 | ) |
| 878 | # adding the -O option will ignore that assertion |
| 879 | # see: https://docs.python.org/3/using/cmdline.html#cmdoption-O |
| 880 | # We should not see the AssertionError in the output anymore. |
| 881 | commands = dedent( |
| 882 | """ |
| 883 | assert False |
| 884 | 20 + 103 |
| 885 | quit() |
| 886 | """ |
| 887 | ) |
| 888 | stdout, stderr = process.communicate(input=commands.encode("utf-8")) |
| 889 | |
| 890 | assert stderr.startswith(EXPECTED_REPL_BANNER_NO_DEPS), stderr |
| 891 | assert b"AssertionError" not in stderr |
| 892 | assert b">>> " in stdout |
| 893 | assert b"123" in stdout |
| 894 | assert 0 == process.returncode |
| 895 | |
| 896 | |
| 897 | def test_pex_run_strip_env(): |
nothing calls this directly
no test coverage detected