Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a unique dataset ID for each run of BQ system tests. #1131

Merged
merged 1 commit into from
Sep 10, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions system_tests/bigquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

_helpers.PROJECT = TESTS_PROJECT
CLIENT = bigquery.Client()
DATASET_NAME = 'system_tests_%012d' % (1000 * time.time(),)


class TestBigQuery(unittest2.TestCase):
Expand All @@ -36,7 +37,6 @@ def tearDown(self):
doomed.delete()

def test_create_dataset(self):
DATASET_NAME = 'system_tests'
dataset = CLIENT.dataset(DATASET_NAME)
self.assertFalse(dataset.exists())
dataset.create()
Expand All @@ -45,7 +45,6 @@ def test_create_dataset(self):
self.assertEqual(dataset.name, DATASET_NAME)

def test_reload_dataset(self):
DATASET_NAME = 'system_tests'
dataset = CLIENT.dataset(DATASET_NAME)
dataset.friendly_name = 'Friendly'
dataset.description = 'Description'
Expand All @@ -57,7 +56,6 @@ def test_reload_dataset(self):
self.assertEqual(other.description, 'Description')

def test_patch_dataset(self):
DATASET_NAME = 'system_tests'
dataset = CLIENT.dataset(DATASET_NAME)
self.assertFalse(dataset.exists())
dataset.create()
Expand All @@ -70,7 +68,6 @@ def test_patch_dataset(self):
self.assertEqual(dataset.description, 'Description')

def test_update_dataset(self):
DATASET_NAME = 'system_tests'
dataset = CLIENT.dataset(DATASET_NAME)
self.assertFalse(dataset.exists())
dataset.create()
Expand Down Expand Up @@ -106,7 +103,6 @@ def test_list_datasets(self):
self.assertEqual(len(created), len(datasets_to_create))

def test_create_table(self):
DATASET_NAME = 'system_tests'
dataset = CLIENT.dataset(DATASET_NAME)
self.assertFalse(dataset.exists())
dataset.create()
Expand All @@ -124,7 +120,6 @@ def test_create_table(self):
self.assertTrue(table._dataset is dataset)

def test_list_tables(self):
DATASET_NAME = 'system_tests'
dataset = CLIENT.dataset(DATASET_NAME)
self.assertFalse(dataset.exists())
dataset.create()
Expand All @@ -151,7 +146,6 @@ def test_list_tables(self):
self.assertEqual(len(created), len(tables_to_create))

def test_patch_table(self):
DATASET_NAME = 'system_tests'
dataset = CLIENT.dataset(DATASET_NAME)
self.assertFalse(dataset.exists())
dataset.create()
Expand All @@ -172,7 +166,6 @@ def test_patch_table(self):
self.assertEqual(table.description, 'Description')

def test_update_table(self):
DATASET_NAME = 'system_tests'
dataset = CLIENT.dataset(DATASET_NAME)
self.assertFalse(dataset.exists())
dataset.create()
Expand Down Expand Up @@ -205,7 +198,6 @@ def test_load_table_then_dump_table(self):
('Bhettye Rhubble', 27),
]
ROW_IDS = range(len(ROWS))
DATASET_NAME = 'system_tests'
dataset = CLIENT.dataset(DATASET_NAME)
self.assertFalse(dataset.exists())
dataset.create()
Expand Down Expand Up @@ -252,7 +244,6 @@ def test_load_table_from_storage_then_dump_table(self):
('Wylma Phlyntstone', 29),
('Bhettye Rhubble', 27),
]
DATASET_NAME = 'system_tests'
TABLE_NAME = 'test_table'

s_client = StorageClient()
Expand Down