Skip to content
This repository was archived by the owner on Mar 6, 2026. It is now read-only.

Commit e06d93a

Browse files
committed
testing explicit project with additional tests
1 parent 427904b commit e06d93a

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

tests/unit/test_magics.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1762,6 +1762,8 @@ def test_bigquery_magic_with_dict_params_array_value(ipython_ns_cleanup, monkeyp
17621762
run_query_patch = mock.patch(
17631763
"google.cloud.bigquery.magics.magics._run_query", autospec=True
17641764
)
1765+
magics.context.project = "unit-test-project"
1766+
17651767
query_job_mock = mock.create_autospec(
17661768
google.cloud.bigquery.job.QueryJob, instance=True
17671769
)
@@ -1803,6 +1805,8 @@ def test_bigquery_magic_with_dict_params_tuple_value(ipython_ns_cleanup, monkeyp
18031805
run_query_patch = mock.patch(
18041806
"google.cloud.bigquery.magics.magics._run_query", autospec=True
18051807
)
1808+
magics.context.project = "unit-test-project"
1809+
18061810
query_job_mock = mock.create_autospec(
18071811
google.cloud.bigquery.job.QueryJob, instance=True
18081812
)
@@ -1854,6 +1858,7 @@ def test_bigquery_magic_valid_query_in_existing_variable(
18541858
magics.context.credentials = mock.create_autospec(
18551859
google.auth.credentials.Credentials, instance=True
18561860
)
1861+
magics.context.project = "unit-test-project"
18571862

18581863
ipython_ns_cleanup.append((ip, "custom_query"))
18591864
ipython_ns_cleanup.append((ip, "query_results_df"))
@@ -1894,6 +1899,7 @@ def test_bigquery_magic_nonexisting_query_variable(monkeypatch):
18941899
magics.context.credentials = mock.create_autospec(
18951900
google.auth.credentials.Credentials, instance=True
18961901
)
1902+
magics.context.project = "unit-test-project"
18971903

18981904
run_query_patch = mock.patch(
18991905
"google.cloud.bigquery.magics.magics._run_query", autospec=True
@@ -1919,7 +1925,7 @@ def test_bigquery_magic_empty_query_variable_name(monkeypatch):
19191925
magics.context.credentials = mock.create_autospec(
19201926
google.auth.credentials.Credentials, instance=True
19211927
)
1922-
1928+
magics.context.project = "unit-test-project"
19231929
run_query_patch = mock.patch(
19241930
"google.cloud.bigquery.magics.magics._run_query", autospec=True
19251931
)
@@ -1942,6 +1948,7 @@ def test_bigquery_magic_query_variable_non_string(ipython_ns_cleanup, monkeypatc
19421948
magics.context.credentials = mock.create_autospec(
19431949
google.auth.credentials.Credentials, instance=True
19441950
)
1951+
magics.context.project = "unit-test-project"
19451952

19461953
run_query_patch = mock.patch(
19471954
"google.cloud.bigquery.magics.magics._run_query", autospec=True

0 commit comments

Comments
 (0)