Don't call Python2 from Python3
Markus Gerstel
4 years ago
57 | 57 | sentinel_value = "sentinel" |
58 | 58 | tmpdir.join("tempfile").write(sentinel_value) |
59 | 59 | tmpdir.join("reader.py").write("print(open('tempfile').read())") |
60 | command = ["python", tmpdir.join("reader.py")] | |
60 | command = [sys.executable, tmpdir.join("reader.py")] | |
61 | 61 | result = procrunner.run(command, working_directory=tmpdir) |
62 | 62 | assert result["exitcode"] == 0 |
63 | 63 | assert not result["stderr"] |
64 | assert sentinel_value == result["stdout"].strip() | |
64 | assert sentinel_value == result["stdout"].strip().decode() |