This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: test_collections.TestNamedTuple.test_source failing on many buildbots after f09f7ab40ce6
Type: Stage: needs patch
Components: Tests Versions: Python 3.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: rhettinger Nosy List: pitrou, r.david.murray, rhettinger, vstinner
Priority: high Keywords: buildbot

Created on 2011-03-24 12:04 by r.david.murray, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (4)
msg131970 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2011-03-24 12:04
Example:

http://www.python.org/dev/buildbot/all/builders/x86%20FreeBSD%207.2%203.x/builds/1609/steps/test/logs/stdio

======================================================================
FAIL: test_source (test.test_collections.TestNamedTuple)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/test/test_collections.py", line 334, in test_source
    self.assertNotIn('Color', globals())
AssertionError: 'Color' unexpectedly found in {'OrderedDict': <class 'collections.OrderedDict'>, 'forget': <function forget at 0x28e89b34>, 'unittest': <module 'unittest' from '/usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/unittest/__init__.py'>, 'MyOrderedDict': <class 'test.test_collections.MyOrderedDict'>, 'WithSet': <class 'test.test_collections.WithSet'>, 'KeysView': <class 'collections.abc.KeysView'>, 'operator': <module 'operator' (built-in)>, 'shuffle': <bound method Random.shuffle of <random.Random object at 0x286ff014>>, 'TestNT': <class 'test.test_collections.TestNT'>, 'MutableMapping': <class 'collections.abc.MutableMapping'>, 'randrange': <bound method Random.randrange of <random.Random object at 0x286ff014>>, 'unlink': <function unlink at 0x28e89a2c>, 'support': <module 'test.support' from '/usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/test/support.py'>, 'Mapping': <class 'collections.abc.Mapping'>, '__package__': None, 'Callable': <class 'collections.abc.Callable'>, 're': <module 're' from '/usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/re.py'>, 'TestCounter': <class 'test.test_collections.TestCounter'>, 'collections': <module 'collections' from '/usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/collections/__init__.py'>, 'test_main': <function test_main at 0x2c6da8cc>, 'SubclassMappingTests': <class 'test.test_collections.SubclassMappingTests'>, 'ChainMap': <class 'collections.ChainMap'>, '__doc__': 'Unit tests for collections.py.', 'Hashable': <class 'collections.abc.Hashable'>, 'namedtuple': <function namedtuple at 0x2860a7c4>, 'inspect': <module 'inspect' from '/usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/inspect.py'>, 'MutableSet': <class 'collections.abc.MutableSet'>, '__builtins__': {'bytearray': <class 'bytearray'>, 'IndexError': <class 'IndexError'>, 'all': <built-in function all>, 'help': Type help() for interactive help, or help(object) for help about object., 'vars': <built-in function vars>, 'SyntaxError': <class 'SyntaxError'>, 'UnicodeDecodeError': <class 'UnicodeDecodeError'>, 'memoryview': <class 'memoryview'>, 'isinstance': <built-in function isinstance>, '__build_class__': <built-in function __build_class__>, 'copyright': Copyright (c) 2001-2011 Python Software Foundation.
msg131972 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2011-03-24 12:08
Link to the commit: f09f7ab40ce6
msg132006 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2011-03-24 16:48
Thanks for the report.  It looks like globals() contamination is happening on the buildbot that isn't happening locally.

Isolated the test in commit 4f1cd92fe835

Will check the buildbots after to make sure it worked.  Otherwise, will delete test.
msg132007 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2011-03-24 16:50
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 :-)
History
Date User Action Args
2022-04-11 14:57:15adminsetgithub: 55870
2011-04-01 23:07:16rhettingersetstatus: open -> closed
resolution: fixed
2011-03-24 16:50:52vstinnersetmessages: + msg132007
2011-03-24 16:48:50rhettingersetmessages: + msg132006
2011-03-24 12:08:07vstinnersetnosy: + vstinner
messages: + msg131972
2011-03-24 12:04:42r.david.murraycreate