Rewrite test without using 'del'