def open_file(title, directory=None):
 result = compat.getopenfilename(parent=active_window(), caption=title, basedir=directory)
 return result[0]

def open_file ( title , directory = None ) : result = compat . getopenfilename ( parent = active_window ( ) , caption = title , basedir = directory ) return result [ 0 ]
open a subunit file this is not a context manager because it is used asynchronously by hooks out of the scope of enable() because we want to patch it in our tests .