Mercurial > pygame
view check_test.py @ 3194:9fcb7abf3185 default tip
Remove some gcc 4.7.2 compiler warnings
| author | Lenard Lindstrom <len-l@telus.net> |
|---|---|
| date | Tue, 23 Apr 2013 19:53:36 -0700 |
| parents | 2d7ce556083b |
| children |
line wrap: on
line source
# Program check_test.py # Requires Python 2.4 """A program for listing the modules accessed by a Pygame unit test module Usage: python check_test.py <test module> e.g. python check_test.py surface_test.py The returned list will show which Pygame modules were imported and accessed. Each module name is followed by a list of attributes accessed. """ import sys import os import trackmod trackmod.begin(pattern=['pygame', 'pygame.*'], continuous=True, submodule_accesses=False) skip = set(['pygame.locals', 'pygame.constants', 'pygame.base', 'pygame.threads']) os.chdir('test') test_file = sys.argv[1] del sys.argv[1] try: execfile(test_file) finally: trackmod.end() print "=== Pygame package submodule accesses ===" print accesses = [(n, a) for n, a in trackmod.get_accesses().iteritems() if n not in skip] accesses.sort(key=lambda t: t[0]) for name, attributes in accesses: print "%s (%s)" % (name, ', '.join(attributes))
