Why does pytest assertion rewrite fail with TypeError on files starting with a number?