Implement B011 from flake8-bugbear (#390)

This commit is contained in:
Charlie Marsh 2022-10-10 10:55:55 -04:00 committed by GitHub
parent 5a06fb28fd
commit 022ff64d29
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 138 additions and 4 deletions

View file

@ -810,6 +810,18 @@ mod tests {
Ok(())
}
#[test]
fn b011() -> Result<()> {
let mut checks = check_path(
Path::new("./resources/test/fixtures/B011.py"),
&settings::Settings::for_rule(CheckCode::B011),
&fixer::Mode::Generate,
)?;
checks.sort_by_key(|check| check.location);
insta::assert_yaml_snapshot!(checks);
Ok(())
}
#[test]
fn c400() -> Result<()> {
let mut checks = check_path(