This repository was archived by the owner on Apr 1, 2026. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +41
-6
lines changed
Expand file tree Collapse file tree 2 files changed +41
-6
lines changed Original file line number Diff line number Diff line change 22
33## Testing
44
5- We use ` pytest ` to instrument our tests.
5+ We use ` nox ` to instrument our tests.
66
7- - To test your changes, run unit tests with ` pytest ` :
7+ - To test your changes, run unit tests with ` nox ` :
88
99 ``` bash
10- pytest < test_file> ::< test>
10+ nox -r -s unit
11+ ```
12+
13+ - To run a single unit test:
14+
15+ ``` bash
16+ nox -r -s unit-3.13 -- -k < name of test>
17+ ```
18+
19+ - Ignore this step if you lack access to Google Cloud resources. To run system
20+ tests, you can execute::
21+
22+ # Run all system tests
23+ $ nox -r -s system
24+
25+ # Run a single system test
26+ $ nox -r -s system-3.13 -- -k <name of test >
27+
28+ - The codebase must have better coverage than it had previously after each
29+ change. You can test coverage via ` nox -s unit system cover ` (takes a long
30+ time). Omit ` system ` if you lack access to cloud resources.
31+
32+ ## Code Style
33+
34+ - We use the automatic code formatter ` black ` . You can run it using
35+ the nox session ` format ` . This will eliminate many lint errors. Run via:
36+
37+ ``` bash
38+ nox -r -s format
39+ ```
40+
41+ - PEP8 compliance is required, with exceptions defined in the linter configuration.
42+ If you have `` nox `` installed, you can test that you have not introduced
43+ any non-compliant code via:
44+
45+ ```
46+ nox -r -s lint
1147 ```
1248
1349- When writing tests, use the idiomatic "pytest" style.
Original file line number Diff line number Diff line change @@ -270,7 +270,7 @@ def test_generate_table_with_options(mock_dataframe, mock_session):
270270
271271
272272@mock .patch ("bigframes.pandas.read_pandas" )
273- def test_generate_table_with_pandas_dataframe (
273+ def test_generate_text_with_pandas_dataframe (
274274 read_pandas_mock , mock_dataframe , mock_session
275275):
276276 # This tests that pandas input path works and calls read_pandas
@@ -281,10 +281,9 @@ def test_generate_table_with_pandas_dataframe(
281281
282282 pandas_df = pd .DataFrame ({"content" : ["test" ]})
283283
284- bbq .ai .generate_table (
284+ bbq .ai .generate_text (
285285 model_name ,
286286 pandas_df ,
287- output_schema = "col1 STRING" ,
288287 )
289288
290289 read_pandas_mock .assert_called_once ()
You can’t perform that action at this time.
0 commit comments