diff --git a/src/rules/flake8_executable/rules/shebang_python.rs b/src/rules/flake8_executable/rules/shebang_python.rs index 4e9ca15f4d..8d00053b26 100644 --- a/src/rules/flake8_executable/rules/shebang_python.rs +++ b/src/rules/flake8_executable/rules/shebang_python.rs @@ -20,7 +20,7 @@ impl Violation for ShebangPython { /// EXE003 pub fn shebang_python(lineno: usize, shebang: &ShebangDirective) -> Option { if let ShebangDirective::Match(_, start, end, content) = shebang { - if content.contains("python") { + if content.contains("python") || content.contains("pytest") { None } else { let diagnostic = Diagnostic::new(