1import atexit 2 3def application(environ, start_response): 4 test_dir = environ.get('HTTP_TEST_DIR') 5 6 def create_file(): 7 open(test_dir + '/atexit', 'w') 8 9 atexit.register(create_file) 10 11 start_response('200', [('Content-Length', '0')]) 12 return [] 13