<s> """<STR_LIT>""" <EOL> from __future__ import print_function <EOL> import os <EOL> from multiprocessing import Process <EOL> import pytest <EOL> __version__ = '<STR_LIT>' <EOL> BEEP_CHARACTER = '<STR_LIT>' <EOL> def bool_config ( app , setting , default = None ) : <EOL> value = app . config . get ( setting ) <EOL> return ( default <EOL> if value is None else <EOL> str ( app . config . get ( setting ) ) . lower ( ) == '<STR_LIT:true>' ) <EOL> def run_tests_sync ( beep = True , exitfirst = True , quiet = True , * extra_args ) : <EOL> argv = [ ] <EOL> if exitfirst : <EOL> argv += [ '<STR_LIT>' ] <EOL> if quiet : <EOL> argv += [ '<STR_LIT>' ] <EOL> if extra_args : <EOL> argv += extra_args <EOL> exit_code = pytest . main ( argv ) <EOL> if exit_code != <NUM_LIT:0> and beep : <EOL> print ( BEEP_CHARACTER , end = '<STR_LIT>' ) <EOL> def start_tests ( beep = True , exitfirst = True , quiet = True , * extra_args ) : <EOL> print ( '<STR_LIT>' ) <EOL> p = Process ( target = run_tests_sync , name = '<STR_LIT>' , <EOL> args = ( beep , exitfirst , quiet ) + extra_args ) <EOL> p . daemon = True <EOL> p . start ( ) <EOL> def FlaskPytest ( app , * extra_args ) : <EOL> inner_run = app . run <EOL> def run_app ( * args , ** kwargs ) : <EOL> if ( app . debug and os . environ . get ( '<STR_LIT>' ) and <EOL> bool_config ( app , '<STR_LIT>' , True ) ) : <EOL> start_tests ( <EOL> bool_config ( app , '<STR_LIT>' , True ) , <EOL> bool_config ( app , '<STR_LIT>' , True ) , <EOL> bool_config ( app , '<STR_LIT>' , True ) , <EOL> * extra_args ) <EOL> return inner_run ( * args , ** kwargs ) <EOL> app . run = run_app <EOL> return app </s>
