From 092ea61eed37f2221c7148ab9904a6bc738c19c0 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Thu, 22 Dec 2022 08:39:48 -0500 Subject: [PATCH] Allow unittest methods in flake8-boolean-trap --- src/flake8_boolean_trap/plugins.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/flake8_boolean_trap/plugins.rs b/src/flake8_boolean_trap/plugins.rs index 339fe59f5d6d8..fe6b5f866a6fb 100644 --- a/src/flake8_boolean_trap/plugins.rs +++ b/src/flake8_boolean_trap/plugins.rs @@ -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