[Freeipa-devel] [patch 0010] Python list comprehension leak breaking the test execution

Milan Kubík mkubik at redhat.com
Tue Aug 11 08:03:38 UTC 2015


On 08/11/2015 09:57 AM, Martin Babinsky wrote:
> 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.
>
Thanks for the suggestion, Martin.

I will try that. Though, I suspect there may be other labels holding 
references to nss objects. I think I will combine this with Jan's 
suggestion.

I will send an update once I'll have the results from a test run.

Milan




More information about the Freeipa-devel mailing list