Skip to content

Commit

Permalink
Use call
Browse files Browse the repository at this point in the history
  • Loading branch information
harupy committed Nov 21, 2024
1 parent 1ddef63 commit 3f385b6
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -800,21 +800,20 @@ pub(crate) fn parametrize(checker: &mut Checker, call: &ExprCall) {
return;
}

let ExprCall { arguments, .. } = call;
if checker.enabled(Rule::PytestParametrizeNamesWrongType) {
if let Some(names) = arguments.find_argument("argnames", 0) {
if let Some(names) = call.arguments.find_argument("argnames", 0) {
check_names(checker, call, names);
}
}
if checker.enabled(Rule::PytestParametrizeValuesWrongType) {
if let Some(names) = arguments.find_argument("argnames", 0) {
if let Some(values) = arguments.find_argument("argvalues", 1) {
if let Some(names) = call.arguments.find_argument("argnames", 0) {
if let Some(values) = call.arguments.find_argument("argvalues", 1) {
check_values(checker, names, values);
}
}
}
if checker.enabled(Rule::PytestDuplicateParametrizeTestCases) {
if let Some(values) = arguments.find_argument("argvalues", 1) {
if let Some(values) = call.arguments.find_argument("argvalues", 1) {
check_duplicates(checker, values);
}
}
Expand Down

0 comments on commit 3f385b6

Please sign in to comment.