()
| 1145 | } |
| 1146 | |
| 1147 | fn python_command() -> String { |
| 1148 | for key in ["MCP_TEST_PYTHON", "PYTHON3", "PYTHON"] { |
| 1149 | if let Ok(value) = std::env::var(key) { |
| 1150 | if !value.trim().is_empty() { |
| 1151 | return value; |
| 1152 | } |
| 1153 | } |
| 1154 | } |
| 1155 | |
| 1156 | for candidate in ["python3", "python"] { |
| 1157 | if Command::new(candidate).arg("--version").output().is_ok() { |
| 1158 | return candidate.to_string(); |
| 1159 | } |
| 1160 | } |
| 1161 | |
| 1162 | panic!("expected a Python interpreter for MCP stdio tests") |
| 1163 | } |
| 1164 | |
| 1165 | fn cleanup_script(script_path: &Path) { |
| 1166 | if let Err(error) = fs::remove_file(script_path) { |
no test coverage detected