#NEWLINE# def test_invalid_file_data( self ) : #NEWLINE# #INDENT# '\n        Invalid file data handled.\n        ' #NEWLINE# invalid_file = FilePath ( self . mktemp ( ) ) #NEWLINE# with invalid_file . open ( 'w' ) as f : #NEWLINE# #INDENT# f . write ( 'hello\n' ) #NEWLINE# #UNINDENT# options = BenchmarkOptions ( ) #NEWLINE# options . parseOptions ( [ '--userdata' , '@{}' . format ( invalid_file . path ) ] ) #NEWLINE# with capture_stderr ( ) as captured_stderr : #NEWLINE# #INDENT# exception = self . assertRaises ( SystemExit , parse_userdata , options ) #NEWLINE# self . assertIn ( 'Invalid user data' , captured_stderr . args [ 0 ] ) #NEWLINE# self . assertIn ( options . getUsage ( ) , captured_stderr ( ) )