Skip to content

Commit 589fbdd

Browse files
author
Bill Prin
committed
Remove single value use case
1 parent 8b24b0b commit 589fbdd

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

bigquery/tests/test_async_query.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import unittest
1717

1818
from bigquery.samples.async_query import run, main
19-
from tests import CloudBaseTest, mock_raw_input_list, BUCKET_NAME_ENV, \
19+
from tests import CloudBaseTest, mock_raw_input, BUCKET_NAME_ENV, \
2020
PROJECT_ID_ENV
2121

2222
class TestAsyncQuery(CloudBaseTest):
@@ -37,7 +37,7 @@ def test_async_query_runner(self):
3737
test_project_id = os.environ.get(PROJECT_ID_ENV)
3838
answers = [test_bucket_name, test_project_id, 'n',
3939
'1', '1']
40-
with mock_raw_input_list(answers):
40+
with mock_raw_input(answers):
4141
main()
4242

4343

tests/__init__.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
os.path.abspath(os.path.dirname(__file__)), 'resources')
2828

2929

30-
class mock_raw_input_list(object):
30+
class mock_raw_input(object):
3131

3232
def __init__(self, list_):
3333
self.i = 0
@@ -46,14 +46,6 @@ def __exit__(self, exc_type, exc_value, traceback):
4646
__builtin__.raw_input = self.raw_input_cache
4747

4848

49-
@contextmanager
50-
def mock_raw_input(mock):
51-
original_raw_input = __builtin__.raw_input
52-
__builtin__.raw_input = mock
53-
yield
54-
__builtin__.raw_input = original_raw_input
55-
56-
5749
class CloudBaseTest(unittest.TestCase):
5850

5951
def setUp(self):

0 commit comments

Comments
 (0)