Show
Ignore:
Timestamp:
01/25/11 17:20:18 (16 months ago)
Author:
Menno Smits <menno@…>
Branch:
default
Message:

Removed unit test running plumbing

People can just use the unit2 script or "python -m unittest". Updated
documentation to match.

Also fixed up the docs for livetest.py to better match current reality.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • imapclient/test/__init__.py

    r156 r197  
    22# Released subject to the New BSD License 
    33# Please see http://en.wikipedia.org/wiki/BSD_licenses 
    4  
    5 import sys 
    6 import glob 
    7 import imp 
    8 import unittest 
    9 from os.path import abspath, dirname, basename, join as joinpath 
    10  
    11 _mydir = abspath(joinpath(dirname(__file__))) 
    12  
    13 # Make sure that imapclient is imported from the right place 
    14 _import_dir = abspath(joinpath(_mydir, '..', '..')) 
    15 sys.path.insert(0, _import_dir) 
    16  
    17 def load_suite(): 
    18     full_suite = unittest.TestSuite() 
    19     for modpath in glob.glob(joinpath(_mydir, 'test_*.py')): 
    20         module_name = basename(modpath).split('.', 1)[0] 
    21         module = imp.load_source(module_name, modpath) 
    22         suite = unittest.defaultTestLoader.loadTestsFromModule(module) 
    23         full_suite.addTest(suite) 
    24     return full_suite 
    25  
    26 def run_suite(): 
    27     suite = load_suite() 
    28     runner = unittest.TextTestRunner(verbosity=1) 
    29     runner.run(suite) 
    30  
    31