@@ -199,9 +199,12 @@ def test_engine_with_dataset(engine_using_test_dataset):
199199 rows = table_one_row .select ().execute ().fetchall ()
200200 assert list (rows [0 ]) == ONE_ROW_CONTENTS_EXPANDED
201201
202- # Table name shouldn't include dataset
203- with pytest .raises (Exception ):
204- table_one_row = Table ('test_pybigquery.sample_one_row' , MetaData (bind = engine_using_test_dataset ), autoload = True )
202+ table_one_row = Table ('test_pybigquery.sample_one_row' , MetaData (bind = engine_using_test_dataset ), autoload = True )
203+ rows = table_one_row .select ().execute ().fetchall ()
204+ # verify that we are pulling from the specifically-named dataset,
205+ # instead of pulling from the default dataset of the engine (which
206+ # does not have this table at all)
207+ assert list (rows [0 ]) == ONE_ROW_CONTENTS_EXPANDED
205208
206209
207210def test_dataset_location (engine_with_location ):
@@ -478,6 +481,14 @@ def test_has_table(engine, engine_using_test_dataset):
478481 assert engine .has_table ('sample' , 'test_pybigquery' ) is True
479482 assert engine .has_table ('test_pybigquery.sample' ) is True
480483
484+ assert engine .has_table ('sample_alt' , 'test_pybigquery_alt' ) is True
485+ assert engine .has_table ('test_pybigquery_alt.sample_alt' ) is True
486+
481487 assert engine_using_test_dataset .has_table ('sample' ) is True
482- with pytest .raises (Exception ):
483- assert engine_using_test_dataset .has_table ('test_pybigquery.sample' ) is True
488+ assert engine_using_test_dataset .has_table ('sample' , 'test_pybigquery' ) is True
489+ assert engine_using_test_dataset .has_table ('test_pybigquery.sample' ) is True
490+
491+ assert engine_using_test_dataset .has_table ('sample_alt' ) is False
492+
493+ assert engine_using_test_dataset .has_table ('sample_alt' , 'test_pybigquery_alt' ) is True
494+ assert engine_using_test_dataset .has_table ('test_pybigquery_alt.sample_alt' ) is True
0 commit comments