Skip to content

Commit

Permalink
Allow unittest methods in flake8-boolean-trap (#1333)
Browse files Browse the repository at this point in the history
  • Loading branch information
charliermarsh committed Dec 22, 2022
1 parent a4a24a0 commit 3eff9a2
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/flake8_boolean_trap/plugins.rs
Expand Up @@ -5,7 +5,18 @@ use crate::ast::types::Range;
use crate::checkers::ast::Checker;
use crate::checks::{Check, CheckKind};

const FUNC_NAME_ALLOWLIST: &[&str] = &["get", "setdefault", "pop", "fromkeys"];
const FUNC_NAME_ALLOWLIST: &[&str] = &[
"assertEqual",
"assertEquals",
"assertNotEqual",
"assertNotEquals",
"failIfEqual",
"failUnlessEqual",
"fromkeys",
"get",
"pop",
"setdefault",
];

/// Returns `true` if an argument is allowed to use a boolean trap. To return
/// `true`, the function name must be explicitly allowed, and the argument must
Expand Down

0 comments on commit 3eff9a2

Please sign in to comment.