From 2d3b4a6d88f4de2231c7b8a9d31c966d1ec30722 Mon Sep 17 00:00:00 2001 From: harupy Date: Mon, 12 Sep 2022 20:20:17 +0900 Subject: [PATCH] Add test case for assignment-expression in E741.py --- resources/test/fixtures/E741.py | 3 +++ src/linter.rs | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/resources/test/fixtures/E741.py b/resources/test/fixtures/E741.py index d8fcf11922..a238b578e4 100644 --- a/resources/test/fixtures/E741.py +++ b/resources/test/fixtures/E741.py @@ -70,3 +70,6 @@ try: pass except ValueError as l: pass + +if (l := 5) > 0: + pass diff --git a/src/linter.rs b/src/linter.rs index 15296ea24f..27bce8f9f3 100644 --- a/src/linter.rs +++ b/src/linter.rs @@ -431,6 +431,11 @@ mod tests { location: Location::new(71, 1), fix: None, }, + Check { + kind: CheckKind::AmbiguousVariableName("l".to_string()), + location: Location::new(74, 5), + fix: None, + }, ]; assert_eq!(actual.len(), expected.len());