Test that PYTHONSAFEPATH is set for Python subprocess calls to prevent CWD shadowing (issue #1575).
()
| 26 | |
| 27 | |
| 28 | def test_subprocess_pythonsafepath_set_for_python_commands() -> None: |
| 29 | """Test that PYTHONSAFEPATH is set for Python subprocess calls to prevent CWD shadowing (issue #1575).""" |
| 30 | result = run_subprocess( |
| 31 | [sys.executable, "-c", "import os, sys; sys.stdout.write(os.environ.get('PYTHONSAFEPATH', ''))"] |
| 32 | ) |
| 33 | |
| 34 | assert result.stdout == "1" |
nothing calls this directly
no test coverage detected