def make_test_filename(fname, purpose):
 (base, ext) = os.path.splitext(fname)
 return (u'%s-%s%s' % (base, purpose, ext))

def make_test_filename ( fname , purpose ) : ( base , ext ) = os . path . splitext ( fname ) return ( u'%s-%s%s' % ( base , purpose , ext ) )
make a new filename by inserting purpose before the files extension .