Changeset 22

Show
Ignore:
Timestamp:
10/11/2007 05:09:58 AM (15 months ago)
Author:
mikeal
Message:

Added a registry key so embedded frameworks can tell if the test was envoked with functest or not.

Added an Interface class Runner implementors.

Fixed bug in output printing.

-Mikeal

Location:
trunk/functest
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/functest/bin.py

    r17 r22  
    5353    import functest 
    5454    functest.configure() 
     55    functest.registry['functest_cli'] = True 
    5556     
    5657    args = list(sys.argv) 
  • trunk/functest/runner.py

    r10 r22  
    1818 
    1919 
     20class FunctestRunnerInterface(object): 
     21    """Simple class that returns a stub function if one of the methods isn't implemented""" 
     22    def __getattr__(self, name): 
     23        return lambda *args, **kwargs : None 
     24 
    2025class CLIRunner(object): 
    2126     
    22     indentation = 0     
     27    indentation = 0 
    2328     
    2429    def start(self): pass 
     
    7075    def begin_tests_in_module(self, module, tests): 
    7176        self.output.write(self.indentation*' '+module.__name__+'.tests:') 
     77        self.output.flush() 
    7278         
    7379    def test_function_passed(self, test): 
     
    8793    def end_tests_in_module(self, module, tests): 
    8894        self.output.write('\n') 
    89         self.output.flush() 
    9095     
    9196    def print_wrapped_output(self):