[Zope-Checkins] CVS: Zope/utilities - testrunner.py:1.19

Shane Hathaway shane@digicool.com
Fri, 19 Oct 2001 12:34:36 -0400


Update of /cvs-repository/Zope/utilities
In directory cvs.zope.org:/tmp/cvs-serv8055

Modified Files:
	testrunner.py 
Log Message:
Tests MUST NOT modify sys.path, and if they do, they shall be chastised for
their disobedience.


=== Zope/utilities/testrunner.py 1.18 => 1.19 ===
         name, ext=os.path.splitext(filename)
         file, pathname, desc=imp.find_module(name, [path])
+        saved_syspath = sys.path[:]
         try:
             module=imp.load_module(name, file, pathname, desc)
         finally:
             file.close()
+            sys.path[:] = saved_syspath
         function=getattr(module, 'test_suite', None)
         if function is None:
             return None