@with_setup(prepare_stderr)
def test_try_to_import_terrain():
 sandbox_path = ojoin('..', 'sandbox')
 original_path = abspath('.')
 os.chdir(sandbox_path)
 try:
  import lettuce
  reload(lettuce)
  raise AssertionError('The runner should raise ImportError !')
 except LettuceRunnerError:
  assert_stderr_lines_with_traceback(('Lettuce has tried to load the conventional environment module "terrain"\nbut it has errors, check its contents and try to run lettuce again.\n\nOriginal traceback below:\n\nTraceback (most recent call last):\n  File "%(lettuce_core_file)s", line 44, in <module>\n    terrain = fs.FileSystem._import("terrain")\n  File "%(lettuce_fs_file)s", line 63, in _import\n    module = imp.load_module(name, fp, pathname, description)\n  File "%(terrain_file)s", line 18\n    it is here just to cause a syntax error\n                  ^\nSyntaxError: invalid syntax\n' % {'lettuce_core_file': abspath(join(lettuce_dir, '__init__.py')), 'lettuce_fs_file': abspath(join(lettuce_dir, 'fs.py')), 'terrain_file': abspath(lettuce_path('..', 'tests', 'functional', 'sandbox', 'terrain.py'))}))
 finally:
  os.chdir(original_path)

@ with_setup ( prepare_stderr ) def test_try_to_import_terrain ( ) : sandbox_path = ojoin ( '..' , 'sandbox' ) original_path = abspath ( '.' ) os . chdir ( sandbox_path ) try : import lettuce reload ( lettuce ) raise AssertionError ( 'The runner should raise ImportError !' ) except LettuceRunnerError : assert_stderr_lines_with_traceback ( ( 'Lettuce has tried to load the conventional environment module "terrain"\nbut it has errors, check its contents and try to run lettuce again.\n\nOriginal traceback below:\n\nTraceback (most recent call last):\n  File "%(lettuce_core_file)s", line 44, in <module>\n    terrain = fs.FileSystem._import("terrain")\n  File "%(lettuce_fs_file)s", line 63, in _import\n    module = imp.load_module(name, fp, pathname, description)\n  File "%(terrain_file)s", line 18\n    it is here just to cause a syntax error\n                  ^\nSyntaxError: invalid syntax\n' % { 'lettuce_core_file' : abspath ( join ( lettuce_dir , '__init__.py' ) ) , 'lettuce_fs_file' : abspath ( join ( lettuce_dir , 'fs.py' ) ) , 'terrain_file' : abspath ( lettuce_path ( '..' , 'tests' , 'functional' , 'sandbox' , 'terrain.py' ) ) } ) ) finally : os . chdir ( original_path )
runner tries to import terrain .