#NEWLINE# @ tornado . testing . gen_test #NEWLINE# def test_hook_in_PYTHON_PATH( self ) : #NEWLINE# #INDENT# tempdir = self . get_tmpdir ( ) #NEWLINE# hook = 'def hook(*args, **kw):\n    return True\n' #NEWLINE# with open ( os . path . join ( tempdir , 'plugins.py' ) , 'w' ) as f : #NEWLINE# #INDENT# f . write ( hook ) #NEWLINE# #UNINDENT# old_environ = os . environ #NEWLINE# try : #NEWLINE# #INDENT# os . environ = { #NEWLINE# #INDENT# 'PYTHONPATH' : old_environ , #NEWLINE# #UNINDENT# } #NEWLINE# hooks = { #NEWLINE# #INDENT# 'before_start' : ( 'plugins.hook' , False ) , #NEWLINE# #UNINDENT# } #NEWLINE# watcher = Watcher ( 'foo' , 'foobar' , copy_env = True , hooks = hooks ) #NEWLINE# self . assertEqual ( watcher . env , os . environ ) #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# os . environ = old_environ