Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Changeset 266

Show
Ignore:
Timestamp:
06/10/05 13:26:37
Author:
fumanchu
Message:

test.py can now be run from any cwd

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/ticket-177/cherrypy/test/test.py

    r264 r266  
    2929import time 
    3030import sys 
    31 import os 
     31import os, os.path 
    3232import unittest 
    3333 
     
    126126 
    127127def main(): 
     128    # Place our current directory's parent (cherrypy/) at the beginning 
     129    # of sys.path, so that all imports are from our current directory. 
     130    localDir = os.path.dirname(__file__) 
     131    curpath = os.path.normpath(os.path.join(os.getcwd(), localDir)) 
     132    sys.path.insert(0, os.path.normpath(os.path.join(curpath, '../../'))) 
     133     
    128134    print "Python version used to run this test script:", sys.version.split()[0] 
    129135    try: 

Hosted by WebFaction

Log in as guest/cpguest to create tickets