Use Test::Warnings instead of local $SIG{__WARN__}