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

Commit 2d1ded3

Browse files
committed
use mock_credentials in magics tests
1 parent a72e1bf commit 2d1ded3

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

tests/unit/bigquery/test_pyformat.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ def test_parse_fields(sql_template: str, expected: list[str]):
4040
assert fields == expected
4141

4242

43+
@pytest.mark.usefixtures("mock_credentials")
4344
def test_pyformat_with_unsupported_type_raises_typeerror(ipython_ns_cleanup):
4445
globalipapp.start_ipython()
4546
ip = globalipapp.get_ipython()
@@ -57,6 +58,7 @@ def test_pyformat_with_unsupported_type_raises_typeerror(ipython_ns_cleanup):
5758
ip.run_cell_magic("bigquery", "--pyformat", sql)
5859

5960

61+
@pytest.mark.usefixtures("mock_credentials")
6062
def test_pyformat_with_missing_variable_raises_keyerror():
6163
globalipapp.start_ipython()
6264
ip = globalipapp.get_ipython()
@@ -68,6 +70,7 @@ def test_pyformat_with_missing_variable_raises_keyerror():
6870
ip.run_cell_magic("bigquery", "--pyformat", sql)
6971

7072

73+
@pytest.mark.usefixtures("mock_credentials")
7174
def test_pyformat_with_no_variables():
7275
globalipapp.start_ipython()
7376
ip = globalipapp.get_ipython()
@@ -159,6 +162,7 @@ def test_pyformat_with_query_dollar_variable_replaces_variables(ipython_ns_clean
159162
run_query_mock.assert_called_once_with(mock.ANY, expected_sql, mock.ANY)
160163

161164

165+
@pytest.mark.usefixtures("mock_credentials")
162166
def test_without_pyformat_doesnt_modify_curly_brackets(ipython_ns_cleanup):
163167
globalipapp.start_ipython()
164168
ip = globalipapp.get_ipython()

0 commit comments

Comments
 (0)