Commits

Denis Bilenko committed 73b6593

copy the test file itself into temp dir, as some tests do open(__file__)

  • Participants
  • Parent commits ed1cce0

Comments (0)

Files changed (1)

greentest/helper.py

 import glob
 from pipes import quote
 
-chdir = os.path.join(tempfile.gettempdir(), 'gevent-test')
+CHDIR = os.path.join(tempfile.gettempdir(), 'gevent-test')
 try:
-    os.makedirs(chdir)
+    os.makedirs(CHDIR)
 except EnvironmentError:
     pass
 
 
     print >> sys.stderr, 'Testing %s with monkey patching' % _filename
 
+    os.system('cp %s %s' % (quote(filename), quote(os.path.join(CHDIR, os.path.basename(filename)))))
+    os.chdir(CHDIR)
     copy_assets(os.path.dirname(_filename), assets)
-    os.chdir(chdir)
     return module_code
 
 
             if isinstance(assets, basestring):
                 assets = glob.glob(assets)
             for asset in assets:
-                os.system('cp -r %s %s' % (quote(asset), quote(os.path.join(chdir, asset))))
+                os.system('cp -r %s %s' % (quote(asset), quote(os.path.join(CHDIR, asset))))
         finally:
             os.chdir(cwd)