Use a cláusula IF EXISTS :
DROP USER IF EXISTS '${test}'@'localhost';
An error occurs if you try to drop an account that does not exist. If the
IF EXISTSclause is given, the statement produces a warning for each named user that does not exist, rather than an error.