8000 Fix test randomness (#1044) · johnmanong/python-docs-samples@0ca81d0 · GitHub
[go: up one dir, main page]

Skip to content

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0ca81d0

Browse files
PicardParisJon Wayne Parrott
authored and
Jon Wayne Parrott
committed
Fix test randomness (GoogleCloudPlatform#1044)
1 parent bb06dad commit 0ca81d0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

bigquery/cloud-client/sync_query_test.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,13 @@
1616

1717

1818
def test_sync_query(capsys):
19+
# Query only outputs the first 10 rows, sort results to avoid randomness
1920
query = (
2021
'SELECT corpus FROM `publicdata.samples.shakespeare` '
21-
'GROUP BY corpus;')
22+
'GROUP BY corpus ORDER BY corpus')
2223

2324
sync_query(query)
2425

2526
out, _ = capsys.readouterr()
2627

27-
assert 'romeoandjuliet' in out
28+
assert 'antonyandcleopatra' in out

0 commit comments

Comments
 (0)
0