Add check for W292 (#339)

This commit is contained in:
Chris Pryer 2022-10-07 21:10:16 -04:00 committed by GitHub
parent 95dfc61315
commit 473675fffb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 130 additions and 9 deletions

View file

@ -339,6 +339,30 @@ mod tests {
Ok(())
}
#[test]
fn w292_0() -> Result<()> {
let mut checks = check_path(
Path::new("./resources/test/fixtures/W292_0.py"),
&settings::Settings::for_rule(CheckCode::W292),
&fixer::Mode::Generate,
)?;
checks.sort_by_key(|check| check.location);
insta::assert_yaml_snapshot!(checks);
Ok(())
}
#[test]
fn w292_1() -> Result<()> {
let mut checks = check_path(
Path::new("./resources/test/fixtures/W292_1.py"),
&settings::Settings::for_rule(CheckCode::W292),
&fixer::Mode::Generate,
)?;
checks.sort_by_key(|check| check.location);
insta::assert_yaml_snapshot!(checks);
Ok(())
}
#[test]
fn f401() -> Result<()> {
let mut checks = check_path(