#NEWLINE# def test_make_hook_recorder( testdir ) : #NEWLINE# #INDENT# item = testdir . getitem ( 'def test_func(): pass' ) #NEWLINE# recorder = testdir . make_hook_recorder ( item . config . pluginmanager ) #NEWLINE# assert ( not recorder . getfailures ( ) ) #NEWLINE# pytest . xfail ( 'internal reportrecorder tests need refactoring' ) #NEWLINE# class rep ( ) : #NEWLINE# #INDENT# excinfo = None #NEWLINE# passed = False #NEWLINE# failed = True #NEWLINE# skipped = False #NEWLINE# when = 'call' #NEWLINE# #UNINDENT# recorder . hook . pytest_runtest_logreport ( report = rep ) #NEWLINE# failures = recorder . getfailures ( ) #NEWLINE# assert ( failures == [ rep ] ) #NEWLINE# failures = recorder . getfailures ( ) #NEWLINE# assert ( failures == [ rep ] ) #NEWLINE# class rep ( ) : #NEWLINE# #INDENT# excinfo = None #NEWLINE# passed = False #NEWLINE# failed = False #NEWLINE# skipped = True #NEWLINE# when = 'call' #NEWLINE# #UNINDENT# rep . passed = False #NEWLINE# rep . skipped = True #NEWLINE# recorder . hook . pytest_runtest_logreport ( report = rep ) #NEWLINE# modcol = testdir . getmodulecol ( '' ) #NEWLINE# rep = modcol . config . hook . pytest_make_collect_report ( collector = modcol ) #NEWLINE# rep . passed = False #NEWLINE# rep . failed = True #NEWLINE# rep . skipped = False #NEWLINE# recorder . hook . pytest_collectreport ( report = rep ) #NEWLINE# ( passed , skipped , failed ) = recorder . listoutcomes ( ) #NEWLINE# assert ( ( not passed ) and skipped and failed ) #NEWLINE# ( numpassed , numskipped , numfailed ) = recorder . countoutcomes ( ) #NEWLINE# assert ( numpassed == 0 ) #NEWLINE# assert ( numskipped == 1 ) #NEWLINE# assert ( numfailed == 1 ) #NEWLINE# assert ( len ( recorder . getfailedcollections ( ) ) == 1 ) #NEWLINE# recorder . unregister ( ) #NEWLINE# recorder . clear ( ) #NEWLINE# recorder . hook . pytest_runtest_logreport ( report = rep ) #NEWLINE# pytest . raises ( ValueError , 'recorder.getfailures()' )