def isTestFile(filename):
 basename = os.path.basename(filename)
 return (basename.startswith('test_') and (os.path.splitext(basename)[1] == '.py'))

def isTestFile ( filename ) : basename = os . path . basename ( filename ) return ( basename . startswith ( 'test_' ) and ( os . path . splitext ( basename ) [ 1 ] == '.py' ) )
returns true if filename looks like a file containing unit tests .