diff --git a/source/analysis/preprocessing.ml b/source/analysis/preprocessing.ml index d004bd4c046..375a6eb71a5 100644 --- a/source/analysis/preprocessing.ml +++ b/source/analysis/preprocessing.ml @@ -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) -> diff --git a/source/analysis/test/preprocessingTest.ml b/source/analysis/test/preprocessingTest.ml index 2fdfd1bd355..f23e05a7792 100644 --- a/source/analysis/test/preprocessingTest.ml +++ b/source/analysis/test/preprocessingTest.ml @@ -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"