mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-04 18:58:26 +00:00
28 lines
872 B
Rust
28 lines
872 B
Rust
//! Rules from [flake8-blind-except](https://pypi.org/project/flake8-blind-except/0.2.1/).
|
|
pub(crate) mod rules;
|
|
|
|
#[cfg(test)]
|
|
mod tests {
|
|
use std::convert::AsRef;
|
|
use std::path::Path;
|
|
|
|
use anyhow::Result;
|
|
use test_case::test_case;
|
|
|
|
use crate::linter::test_path;
|
|
use crate::registry::RuleCode;
|
|
use crate::settings;
|
|
|
|
#[test_case(RuleCode::BLE001, Path::new("BLE.py"); "BLE001")]
|
|
fn rules(rule_code: RuleCode, path: &Path) -> Result<()> {
|
|
let snapshot = format!("{}_{}", rule_code.as_ref(), path.to_string_lossy());
|
|
let diagnostics = test_path(
|
|
Path::new("./resources/test/fixtures/flake8_blind_except")
|
|
.join(path)
|
|
.as_path(),
|
|
&settings::Settings::for_rule(rule_code),
|
|
)?;
|
|
insta::assert_yaml_snapshot!(snapshot, diagnostics);
|
|
Ok(())
|
|
}
|
|
}
|