[Freeipa-devel] [patch 0010] Python list comprehension leak breaking the test execution
Martin Babinsky
mbabinsk at redhat.com
Tue Aug 11 07:57:33 UTC 2015
On 08/10/2015 05:43 PM, Milan Kubík wrote:
> Hi all,
>
> this patch fixes problem described in the ticket [1]
> that caused the test run to fail completely at every other or so run.
> I took the liberty to fix most of the pep8 issues while I was at it.
>
> Thanks to Jan Cholasta for help with identifying this one.
>
> [1]: https://fedorahosted.org/freeipa/ticket/5192
>
> Cheers,
> Milan
>
>
Hi Milan,
I did not follow the rest of the conversation (probably should), but you
can also workaround this python2 "feature" by using:
"""
assert list((t.id, t.options) for t in doc.getKeyPackages()) == \
"""
In this case a list is constructed by calling a generator expression
which does not leak variables to the outside scope.
It may or may not help you but I think it's a trick worth trying. As a
bonus it should be py2/3 compatible.
--
Martin^3 Babinsky
More information about the Freeipa-devel
mailing list