[pywin32-checkins] pywin32/win32/test testall.py,1.2,1.3
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: <mha...@us...> - 2003-11-02 10:15:51
|
Update of /cvsroot/pywin32/pywin32/win32/test In directory sc8-pr-cvs1:/tmp/cvs-serv6413 Modified Files: testall.py Log Message: A simple test that every win32 .pyd module can actually import! Index: testall.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/test/testall.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** testall.py 24 Oct 2003 01:49:36 -0000 1.2 --- testall.py 2 Nov 2003 10:15:43 -0000 1.3 *************** *** 2,5 **** --- 2,21 ---- import unittest + def import_all(): + # Some hacks for import order - dde depends on win32ui + import win32ui + + import win32api + dir = os.path.dirname(win32api.__file__) + num = 0 + is_debug = os.path.basename(win32api.__file__).endswith("_d") + for name in os.listdir(dir): + base, ext = os.path.splitext(name) + if (ext==".pyd") and \ + (is_debug and base.endswith("_d") or \ + not is_debug and not base.endswith("_d")): + __import__(base) + num += 1 + def suite(): # Loop over all .py files here, except me :) *************** *** 11,14 **** --- 27,31 ---- files = os.listdir(os.path.dirname(me)) suite = unittest.TestSuite() + suite.addTest(unittest.FunctionTestCase(import_all)) for file in files: base, ext = os.path.splitext(file) |