#NEWLINE# @ xfailif_no_pcre_support #NEWLINE# @ pytest . mark . integration #NEWLINE# def test_pcre_hook_matching( tempdir_factory , store ) : #NEWLINE# #INDENT# path = git_dir ( tempdir_factory ) #NEWLINE# with cwd ( path ) : #NEWLINE# #INDENT# with io . open ( 'herp' , 'w' ) as herp : #NEWLINE# #INDENT# herp . write ( "\nherpfoo'bard\n" ) #NEWLINE# #UNINDENT# with io . open ( 'derp' , 'w' ) as derp : #NEWLINE# #INDENT# derp . write ( '[INFO] information yo\n' ) #NEWLINE# #UNINDENT# _test_hook_repo ( derp , store , 'pcre_hooks_repo' , 'regex-with-quotes' , [ 'herp' , 'derp' ] , b"herp:2:herpfoo'bard\n" , expected_return_code = 1 ) #NEWLINE# _test_hook_repo ( tempdir_factory , store , 'pcre_hooks_repo' , 'other-regex' , [ 'herp' , 'derp' ] , b'derp:1:[INFO] information yo\n' , expected_return_code = 1 )