Fix test failure caused by removal of name variable in d4dd20cba641997f5e2aac3732868e1b66a192e4
This code should be rewritten to not use locals().