@@ -985,7 +985,7 @@ def test_bigquery_magic_dryrun_option_sets_job_config(monkeypatch):
985
985
magics .context .credentials = mock .create_autospec (
986
986
google .auth .credentials .Credentials , instance = True
987
987
)
988
-
988
+ magics . context . project = "project-from-context"
989
989
run_query_patch = mock .patch (
990
990
"google.cloud.bigquery.magics.magics._run_query" , autospec = True
991
991
)
@@ -1007,6 +1007,7 @@ def test_bigquery_magic_dryrun_option_returns_query_job(monkeypatch):
1007
1007
magics .context .credentials = mock .create_autospec (
1008
1008
google .auth .credentials .Credentials , instance = True
1009
1009
)
1010
+ magics .context .project = "project-from-context"
1010
1011
query_job_mock = mock .create_autospec (
1011
1012
google .cloud .bigquery .job .QueryJob , instance = True
1012
1013
)
@@ -1034,7 +1035,7 @@ def test_bigquery_magic_dryrun_option_variable_error_message(
1034
1035
magics .context .credentials = mock .create_autospec (
1035
1036
google .auth .credentials .Credentials , instance = True
1036
1037
)
1037
-
1038
+ magics . context . project = "project-from-context"
1038
1039
ipython_ns_cleanup .append ((ip , "q_job" ))
1039
1040
1040
1041
run_query_patch = mock .patch (
@@ -1064,6 +1065,7 @@ def test_bigquery_magic_dryrun_option_saves_query_job_to_variable(
1064
1065
magics .context .credentials = mock .create_autospec (
1065
1066
google .auth .credentials .Credentials , instance = True
1066
1067
)
1068
+ magics .context .project = "project-from-context"
1067
1069
query_job_mock = mock .create_autospec (
1068
1070
google .cloud .bigquery .job .QueryJob , instance = True
1069
1071
)
@@ -1100,10 +1102,6 @@ def test_bigquery_magic_saves_query_job_to_variable_on_error(
1100
1102
mock .create_autospec (google .auth .credentials .Credentials , instance = True ),
1101
1103
)
1102
1104
magics .context .project = "project-from-context"
1103
- # monkeypatch.setattr(magics.context, "project", "project-from-context")
1104
- # magics.context.credentials = mock.create_autospec(
1105
- # google.auth.credentials.Credentials, instance=True
1106
- # )
1107
1105
1108
1106
ipython_ns_cleanup .append ((ip , "result" ))
1109
1107
0 commit comments