Changeset 938

Show
Ignore:
Timestamp:
10/30/07 14:44:59
Author:
seang
Message:

add open_file into tests run through old runner

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • OWSLib/trunk/tests/runalldoctests.py

    r621 r938  
    1010    pass 
    1111 
     12def open_file(filename, mode='r'): 
     13    """Helper function to open files from within the tests package.""" 
     14    import os 
     15    return open(os.path.join(os.path.dirname(__file__), filename), mode) 
     16 
     17EXTRA_GLOBALS = {'open_file': open_file} 
     18 
    1219def run(pattern): 
    1320    if pattern is None: 
     
    1623        testfiles = glob.glob(pattern) 
    1724    for file in testfiles:  
    18         doctest.testfile(file
     25        doctest.testfile(file, extraglobs=EXTRA_GLOBALS
    1926 
    2027if __name__ == "__main__":