<s> """<STR_LIT>""" <EOL> import py <EOL> figleaf = py . test . importorskip ( "<STR_LIT>" ) <EOL> def pytest_addoption ( parser ) : <EOL> group = parser . addgroup ( '<STR_LIT>' ) <EOL> group . addoption ( '<STR_LIT>' , action = '<STR_LIT:store_true>' , default = False , <EOL> dest = '<STR_LIT>' , <EOL> help = ( '<STR_LIT>' <EOL> '<STR_LIT>' ) ) <EOL> group . addoption ( '<STR_LIT>' , action = '<STR_LIT:store>' , default = '<STR_LIT>' , <EOL> dest = '<STR_LIT>' , <EOL> help = '<STR_LIT>' ) <EOL> group . addoption ( '<STR_LIT>' , action = '<STR_LIT:store>' , default = '<STR_LIT:html>' , <EOL> dest = '<STR_LIT>' , <EOL> help = '<STR_LIT>' ) <EOL> def pytest_configure ( config ) : <EOL> figleaf . start ( ) <EOL> def pytest_terminal_summary ( terminalreporter ) : <EOL> config = terminalreporter . config <EOL> datafile = py . path . local ( config . getvalue ( '<STR_LIT>' ) ) <EOL> tw = terminalreporter . _tw <EOL> tw . sep ( '<STR_LIT:->' , '<STR_LIT>' ) <EOL> tw . line ( '<STR_LIT>' % ( datafile ) ) <EOL> figleaf . stop ( ) <EOL> figleaf . write_coverage ( str ( datafile ) ) <EOL> coverage = get_coverage ( datafile , config ) <EOL> reportdir = py . path . local ( config . getvalue ( '<STR_LIT>' ) ) <EOL> tw . line ( '<STR_LIT>' % ( reportdir ) ) <EOL> figleaf . annotate_html . prepare_reportdir ( str ( reportdir ) ) <EOL> exclude = [ ] <EOL> figleaf . annotate_html . report_as_html ( coverage , <EOL> str ( reportdir ) , exclude , { } ) <EOL> def get_coverage ( datafile , config ) : <EOL> basepath = py . path . local ( ) <EOL> data = figleaf . read_coverage ( str ( datafile ) ) <EOL> d = { } <EOL> coverage = figleaf . combine_coverage ( d , data ) <EOL> for path in coverage . keys ( ) : <EOL> if not py . path . local ( path ) . relto ( basepath ) : <EOL> del coverage [ path ] <EOL> return coverage <EOL> def test_functional ( testdir ) : <EOL> py . test . importorskip ( "<STR_LIT>" ) <EOL> testdir . plugins . append ( "<STR_LIT>" ) <EOL> testdir . makepyfile ( """<STR_LIT>""" ) <EOL> result = testdir . runpytest ( '<STR_LIT>' ) <EOL> assert result . ret == <NUM_LIT:0> <EOL> assert result . stdout . fnmatch_lines ( [ <EOL> '<STR_LIT>' <EOL> ] ) </s>
