[PATCH] test/py: Add support to enable check for bad pattern