Skip to content

Commit

Permalink
Qualify message field for assert statements
Browse files Browse the repository at this point in the history
Reviewed By: connernilsen

Differential Revision: D59820631

fbshipit-source-id: c93ca78a90baf425d2b506281c467b5bb0f4da9e
  • Loading branch information
grievejia authored and facebook-github-bot committed Jul 16, 2024
1 parent 65be73a commit fbedd7a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion source/analysis/preprocessing.ml
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,8 @@ module Qualify (Context : QualifyContext) = struct
Assert
{
Assert.test = qualify_expression ~qualify_strings:DoNotQualify ~scope test;
message;
message =
Option.map message ~f:(qualify_expression ~qualify_strings:DoNotQualify ~scope);
origin;
} )
| Class ({ name; _ } as definition) ->
Expand Down
1 change: 1 addition & 0 deletions source/analysis/test/preprocessingTest.ml
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,7 @@ let test_qualify_source _ =
assert_qualify_statement "(b, b)" "(a, a)";
assert_qualify_statement "-b" "-a";
assert_qualify_statement "assert b" "assert a";
assert_qualify_statement "assert b, b" "assert a, a";
assert_qualify_statement "del b" "del a";
assert_qualify_statement
"b = 1\nfor b in []: pass"
Expand Down

0 comments on commit fbedd7a

Please sign in to comment.