#NEWLINE# def test_no_table_and_create_if_needed_and_no_schema( self ) : #NEWLINE# #INDENT# client = mock . Mock ( ) #NEWLINE# client . tables . Get . side_effect = HttpError ( response = { #NEWLINE# #INDENT# 'status' : '404' , #NEWLINE# #UNINDENT# } , url = '' , content = '' ) #NEWLINE# create_disposition = df . io . BigQueryDisposition . CREATE_IF_NEEDED #NEWLINE# with self . assertRaises ( RuntimeError ) as exn : #NEWLINE# #INDENT# with df . io . BigQuerySink ( 'project:dataset.table' , create_disposition = create_disposition ) . writer ( client ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# #UNINDENT# self . assertEqual ( exn . exception . message , 'Table project:dataset.table requires a schema. None can be inferred because the table does not exist.' )