mirror of
https://github.com/openai/codex.git
synced 2026-08-23 13:09:46 +00:00
[codex] Use expect in integration tests (#28441)
The workspace denies `clippy::expect_used` in production. Although `clippy.toml` allows `expect` in tests, Bazel Clippy compiles integration-test helper code in a way that does not receive that exemption, which encouraged verbose `unwrap_or_else(... panic!(...))` and equivalent `match`/`let else` forms. This allows `clippy::expect_used` once at each integration-test crate root (including aggregated suites and test-support libraries), then replaces manual panic-based Result and Option unwraps with `expect`/`expect_err`. Standalone `tests/*.rs` files remain their own crate roots. Intentional assertion and unexpected-variant panics remain unchanged, and the production `expect_used = "deny"` lint remains in place. The cleanup is mechanical and net-negative in line count.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
#![allow(clippy::expect_used)]
|
||||
use std::any::Any;
|
||||
use std::fs;
|
||||
use std::path::PathBuf;
|
||||
@@ -35,8 +36,7 @@ fn prompt_all(_: &[String]) -> Decision {
|
||||
}
|
||||
|
||||
fn absolute_path(path: &str) -> AbsolutePathBuf {
|
||||
AbsolutePathBuf::try_from(path.to_string())
|
||||
.unwrap_or_else(|error| panic!("expected absolute path `{path}`: {error}"))
|
||||
AbsolutePathBuf::try_from(path.to_string()).expect("path should be absolute")
|
||||
}
|
||||
|
||||
fn host_absolute_path(segments: &[&str]) -> String {
|
||||
|
||||
Reference in New Issue
Block a user