[issue11661] test_collections.TestNamedTuple.test_source failing on many buildbots after f09f7ab40ce6

STINNER Victor report at bugs.python.org
Thu Mar 24 17:50:53 CET 2011


STINNER Victor <victor.stinner at haypocalc.com> added the comment:

Why do you remove NTColor from globals *after* creating it? The assertion looks useless, or are you testing that globals().pop() works as expected?

tmp = namedtuple('NTColor', 'red green blue')
globals().pop('NTColor', None)          # remove artifacts from other tests
self.assertNotIn('NTColor', globals())

Can't you remove NTColor from globals before creating it?

globals().pop('NTColor', None)
tmp = namedtuple('NTColor', 'red green blue')
self.assertNotIn('NTColor', globals())

It looks like I missed something important :-)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11661>
_______________________________________


More information about the Python-bugs-list mailing list