<s> import pytest <EOL> from hermes import models <EOL> @ pytest . fixture <EOL> def db_engine ( tmpdir ) : <EOL> db_path = tmpdir . join ( "<STR_LIT>" ) <EOL> db_engine = models . get_db_engine ( "<STR_LIT>" % db_path ) <EOL> return db_engine <EOL> @ pytest . fixture <EOL> def session ( db_engine , request , tmpdir ) : <EOL> models . Model . metadata . drop_all ( db_engine ) <EOL> models . Model . metadata . create_all ( db_engine ) <EOL> models . Session . configure ( bind = db_engine ) <EOL> session = models . Session ( ) <EOL> models . Fate . _all_fates = None <EOL> def fin ( ) : <EOL> session . close ( ) <EOL> request . addfinalizer ( fin ) <EOL> return session <EOL> @ pytest . fixture <EOL> def sample_data1 ( session ) : <EOL> sql_file = open ( '<STR_LIT>' ) <EOL> sql = sql_file . read ( ) <EOL> for statement in sql . split ( "<STR_LIT:;>" ) : <EOL> session . execute ( statement ) <EOL> return session <EOL> @ pytest . fixture <EOL> def sample_data2 ( session ) : <EOL> sql_file = open ( '<STR_LIT>' ) <EOL> sql = sql_file . read ( ) <EOL> for statement in sql . split ( "<STR_LIT:;>" ) : <EOL> session . execute ( statement ) <EOL> return session </s>
