<s> import os <EOL> import pytest <EOL> from webtest import TestApp <EOL> TEST_SETTINGS = { <EOL> '<STR_LIT>' : os . environ . get ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : True , <EOL> '<STR_LIT>' : True , <EOL> '<STR_LIT>' : True , <EOL> '<STR_LIT>' : os . environ . get ( '<STR_LIT>' , <EOL> '<STR_LIT>' ) <EOL> } <EOL> @ pytest . fixture <EOL> def config ( ) : <EOL> from h . config import configure <EOL> from h . db import Session <EOL> Session . remove ( ) <EOL> config = configure ( ) <EOL> config . registry . settings . update ( TEST_SETTINGS ) <EOL> _drop_indices ( settings = config . registry . settings ) <EOL> config . include ( '<STR_LIT>' ) <EOL> config . include ( '<STR_LIT>' ) <EOL> return config <EOL> @ pytest . fixture <EOL> def app ( config ) : <EOL> return TestApp ( config . make_wsgi_app ( ) ) <EOL> def _drop_indices ( settings ) : <EOL> import elasticsearch <EOL> conn = elasticsearch . Elasticsearch ( [ settings [ '<STR_LIT>' ] ] ) <EOL> for name in [ settings [ '<STR_LIT>' ] , settings [ '<STR_LIT>' ] ] : <EOL> if conn . indices . exists ( index = name ) : <EOL> conn . indices . delete ( index = name ) </s>
