Why does pytest INTERNALERROR when __repr__ and __getattribute__ both raise exceptions?