Unset PYTHONHASHSEED for python subprocess in test
Markus Gerstel
4 years ago
58 | 58 | tmpdir.join("tempfile").write(sentinel_value) |
59 | 59 | tmpdir.join("reader.py").write("print(open('tempfile').read())") |
60 | 60 | command = [sys.executable, tmpdir.join("reader.py")] |
61 | result = procrunner.run(command, working_directory=tmpdir) | |
61 | result = procrunner.run( | |
62 | command, | |
63 | environment_override={"PYTHONHASHSEED": "random"}, | |
64 | working_directory=tmpdir, | |
65 | ) | |
62 | 66 | assert result["exitcode"] == 0 |
63 | 67 | assert not result["stderr"] |
64 | 68 | assert sentinel_value == result["stdout"].strip().decode() |