Skip to content

Drop 'unittest2' dependency. #2056

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

Merged
merged 1 commit into from
Aug 4, 2016
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ install:
# compiled extensions and are not provided as pre-built wheel packages,
# pip will build them from source using the MSVC compiler matching the
# target Python version and architecture
- "%CMD_IN_ENV% pip install wheel nose nose-exclude unittest2 cryptography grpcio"
- "%CMD_IN_ENV% pip install wheel nose nose-exclude cryptography grpcio"
# Install sometimes-problemaatic gRPC-related dependencies
- "%CMD_IN_ENV% pip install grpcio gax-google-pubsub-v1 gax-google-logging-v2"

Expand Down
8 changes: 4 additions & 4 deletions gcloud/bigquery/test__helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import unittest2
import unittest


class Test_ConfigurationProperty(unittest2.TestCase):
class Test_ConfigurationProperty(unittest.TestCase):

def _getTargetClass(self):
from gcloud.bigquery._helpers import _ConfigurationProperty
Expand Down Expand Up @@ -50,7 +50,7 @@ def __init__(self):
self.assertEqual(wrapper._configuration._attr, None)


class Test_TypedProperty(unittest2.TestCase):
class Test_TypedProperty(unittest.TestCase):

def _getTargetClass(self):
from gcloud.bigquery._helpers import _TypedProperty
Expand Down Expand Up @@ -83,7 +83,7 @@ def __init__(self):
self.assertEqual(wrapper._configuration._attr, None)


class Test_EnumProperty(unittest2.TestCase):
class Test_EnumProperty(unittest.TestCase):

def _getTargetClass(self):
from gcloud.bigquery._helpers import _EnumProperty
Expand Down
4 changes: 2 additions & 2 deletions gcloud/bigquery/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import unittest2
import unittest


class TestClient(unittest2.TestCase):
class TestClient(unittest.TestCase):

def _getTargetClass(self):
from gcloud.bigquery.client import Client
Expand Down
4 changes: 2 additions & 2 deletions gcloud/bigquery/test_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import unittest2
import unittest


class TestConnection(unittest2.TestCase):
class TestConnection(unittest.TestCase):

def _getTargetClass(self):
from gcloud.bigquery.connection import Connection
Expand Down
6 changes: 3 additions & 3 deletions gcloud/bigquery/test_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import unittest2
import unittest


class TestAccessGrant(unittest2.TestCase):
class TestAccessGrant(unittest.TestCase):

def _getTargetClass(self):
from gcloud.bigquery.dataset import AccessGrant
Expand Down Expand Up @@ -76,7 +76,7 @@ def test___eq___hit(self):
self.assertEqual(grant, other)


class TestDataset(unittest2.TestCase):
class TestDataset(unittest.TestCase):
PROJECT = 'project'
DS_NAME = 'dataset-name'

Expand Down
12 changes: 6 additions & 6 deletions gcloud/bigquery/test_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import unittest2
import unittest


class Test_UDFResourcesProperty(unittest2.TestCase):
class Test_UDFResourcesProperty(unittest.TestCase):

def _getTargetClass(self):
from gcloud.bigquery.job import UDFResourcesProperty
Expand Down Expand Up @@ -189,7 +189,7 @@ def _verifyReadonlyResourceProperties(self, job, resource):
self.assertEqual(job.user_email, None)


class TestLoadTableFromStorageJob(unittest2.TestCase, _Base):
class TestLoadTableFromStorageJob(unittest.TestCase, _Base):
JOB_TYPE = 'load'

def _getTargetClass(self):
Expand Down Expand Up @@ -695,7 +695,7 @@ def test_cancel_w_alternate_client(self):
self._verifyResourceProperties(job, RESOURCE)


class TestCopyJob(unittest2.TestCase, _Base):
class TestCopyJob(unittest.TestCase, _Base):
JOB_TYPE = 'copy'
SOURCE_TABLE = 'source_table'
DESTINATION_TABLE = 'destination_table'
Expand Down Expand Up @@ -992,7 +992,7 @@ def test_reload_w_alternate_client(self):
self._verifyResourceProperties(job, RESOURCE)


class TestExtractTableToStorageJob(unittest2.TestCase, _Base):
class TestExtractTableToStorageJob(unittest.TestCase, _Base):
JOB_TYPE = 'extract'
SOURCE_TABLE = 'source_table'
DESTINATION_URI = 'gs://bucket_name/object_name'
Expand Down Expand Up @@ -1285,7 +1285,7 @@ def test_reload_w_alternate_client(self):
self._verifyResourceProperties(job, RESOURCE)


class TestQueryJob(unittest2.TestCase, _Base):
class TestQueryJob(unittest.TestCase, _Base):
JOB_TYPE = 'query'
QUERY = 'select count(*) from persons'
DESTINATION_TABLE = 'destination_table'
Expand Down
4 changes: 2 additions & 2 deletions gcloud/bigquery/test_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import unittest2
import unittest


class TestQueryResults(unittest2.TestCase):
class TestQueryResults(unittest.TestCase):
PROJECT = 'project'
JOB_NAME = 'job_name'
JOB_NAME = 'test-synchronous-query'
Expand Down
10 changes: 5 additions & 5 deletions gcloud/bigquery/test_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import unittest2
import unittest


class TestSchemaField(unittest2.TestCase):
class TestSchemaField(unittest.TestCase):

def _getTargetClass(self):
from gcloud.bigquery.table import SchemaField
Expand Down Expand Up @@ -125,7 +125,7 @@ def _verifySchema(self, schema, resource):
self._verify_field(field, r_field)


class TestTable(unittest2.TestCase, _SchemaBase):
class TestTable(unittest.TestCase, _SchemaBase):
PROJECT = 'project'
DS_NAME = 'dataset-name'
TABLE_NAME = 'table-name'
Expand Down Expand Up @@ -1552,7 +1552,7 @@ class _UploadConfig(object):
# pylint: enable=too-many-statements


class Test_parse_schema_resource(unittest2.TestCase, _SchemaBase):
class Test_parse_schema_resource(unittest.TestCase, _SchemaBase):

def _callFUT(self, resource):
from gcloud.bigquery.table import _parse_schema_resource
Expand Down Expand Up @@ -1596,7 +1596,7 @@ def test__parse_schema_resource_fields_without_mode(self):
self._verifySchema(schema, RESOURCE)


class Test_build_schema_resource(unittest2.TestCase, _SchemaBase):
class Test_build_schema_resource(unittest.TestCase, _SchemaBase):

def _callFUT(self, resource):
from gcloud.bigquery.table import _build_schema_resource
Expand Down
6 changes: 3 additions & 3 deletions gcloud/bigtable/happybase/test_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.


import unittest2
import unittest


class _SendMixin(object):
Expand All @@ -24,7 +24,7 @@ def send(self):
self._send_called = True


class TestBatch(unittest2.TestCase):
class TestBatch(unittest.TestCase):

def _getTargetClass(self):
from gcloud.bigtable.happybase.batch import Batch
Expand Down Expand Up @@ -474,7 +474,7 @@ class BatchWithSend(_SendMixin, klass):
self.assertTrue(batch._send_called)


class Test__get_column_pairs(unittest2.TestCase):
class Test__get_column_pairs(unittest.TestCase):

def _callFUT(self, *args, **kwargs):
from gcloud.bigtable.happybase.batch import _get_column_pairs
Expand Down
20 changes: 10 additions & 10 deletions gcloud/bigtable/happybase/test_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@

import sys

import unittest2
import unittest


class Test__get_instance(unittest2.TestCase):
class Test__get_instance(unittest.TestCase):

def _callFUT(self, timeout=None):
from gcloud.bigtable.happybase.connection import _get_instance
Expand Down Expand Up @@ -72,7 +72,7 @@ def test_with_failed_locations(self):
failed_locations=[failed_location])


class TestConnection(unittest2.TestCase):
class TestConnection(unittest.TestCase):

def _getTargetClass(self):
from gcloud.bigtable.happybase.connection import Connection
Expand Down Expand Up @@ -418,8 +418,8 @@ def make_table(*args, **kwargs):
self.assertEqual(len(tables_created), 1)
self.assertEqual(tables_created[0].create_calls, 1)

@unittest2.skipUnless(sys.version_info[:2] == (2, 7),
'gRPC only in Python 2.7')
@unittest.skipUnless(sys.version_info[:2] == (2, 7),
'gRPC only in Python 2.7')
def test_create_table_already_exists(self):
from grpc.beta import interfaces
from grpc.framework.interfaces.face import face
Expand All @@ -429,17 +429,17 @@ def test_create_table_already_exists(self):
interfaces.StatusCode.ALREADY_EXISTS, None)
self._create_table_error_helper(err_val, AlreadyExists)

@unittest2.skipUnless(sys.version_info[:2] == (2, 7),
'gRPC only in Python 2.7')
@unittest.skipUnless(sys.version_info[:2] == (2, 7),
'gRPC only in Python 2.7')
def test_create_table_connection_error(self):
from grpc.beta import interfaces
from grpc.framework.interfaces.face import face
err_val = face.NetworkError(None, None,
interfaces.StatusCode.INTERNAL, None)
self._create_table_error_helper(err_val, face.NetworkError)

@unittest2.skipUnless(sys.version_info[:2] == (2, 7),
'gRPC only in Python 2.7')
@unittest.skipUnless(sys.version_info[:2] == (2, 7),
'gRPC only in Python 2.7')
def test_create_table_other_error(self):
self._create_table_error_helper(RuntimeError, RuntimeError)

Expand Down Expand Up @@ -562,7 +562,7 @@ def mock_warn(msg):
self.assertEqual(warned, [MUT._COMPACT_TMPL % (name, False)])


class Test__parse_family_option(unittest2.TestCase):
class Test__parse_family_option(unittest.TestCase):

def _callFUT(self, option):
from gcloud.bigtable.happybase.connection import _parse_family_option
Expand Down
4 changes: 2 additions & 2 deletions gcloud/bigtable/happybase/test_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
# limitations under the License.


import unittest2
import unittest


class TestConnectionPool(unittest2.TestCase):
class TestConnectionPool(unittest.TestCase):

def _getTargetClass(self):
from gcloud.bigtable.happybase.pool import ConnectionPool
Expand Down
24 changes: 12 additions & 12 deletions gcloud/bigtable/happybase/test_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import unittest2
import unittest


class Test_make_row(unittest2.TestCase):
class Test_make_row(unittest.TestCase):

def _callFUT(self, *args, **kwargs):
from gcloud.bigtable.happybase.table import make_row
Expand All @@ -26,7 +26,7 @@ def test_it(self):
self._callFUT({}, False)


class Test_make_ordered_row(unittest2.TestCase):
class Test_make_ordered_row(unittest.TestCase):

def _callFUT(self, *args, **kwargs):
from gcloud.bigtable.happybase.table import make_ordered_row
Expand All @@ -37,7 +37,7 @@ def test_it(self):
self._callFUT([], False)


class TestTable(unittest2.TestCase):
class TestTable(unittest.TestCase):

def _getTargetClass(self):
from gcloud.bigtable.happybase.table import Table
Expand Down Expand Up @@ -1013,7 +1013,7 @@ def test_counter_inc_result_non_unique_cell(self):
self._counter_inc_helper(row, column, value, commit_result)


class Test__gc_rule_to_dict(unittest2.TestCase):
class Test__gc_rule_to_dict(unittest.TestCase):

def _callFUT(self, *args, **kwargs):
from gcloud.bigtable.happybase.table import _gc_rule_to_dict
Expand Down Expand Up @@ -1102,7 +1102,7 @@ def test_with_intersection_two_nested_rules(self):
self.assertTrue(result is gc_rule)


class Test__string_successor(unittest2.TestCase):
class Test__string_successor(unittest.TestCase):

def _callFUT(self, *args, **kwargs):
from gcloud.bigtable.happybase.table import _string_successor
Expand All @@ -1125,7 +1125,7 @@ def test_with_unicode_input(self):
self.assertEqual(self._callFUT(u'boa'), b'bob')


class Test__convert_to_time_range(unittest2.TestCase):
class Test__convert_to_time_range(unittest.TestCase):

def _callFUT(self, timestamp=None):
from gcloud.bigtable.happybase.table import _convert_to_time_range
Expand Down Expand Up @@ -1153,7 +1153,7 @@ def test_success(self):
self.assertEqual(result.end, ts_dt)


class Test__cells_to_pairs(unittest2.TestCase):
class Test__cells_to_pairs(unittest.TestCase):

def _callFUT(self, *args, **kwargs):
from gcloud.bigtable.happybase.table import _cells_to_pairs
Expand Down Expand Up @@ -1189,7 +1189,7 @@ def test_with_timestamp(self):
[(value1, ts1_millis), (value2, ts2_millis)])


class Test__partial_row_to_dict(unittest2.TestCase):
class Test__partial_row_to_dict(unittest.TestCase):

def _callFUT(self, partial_row_data, include_timestamp=False):
from gcloud.bigtable.happybase.table import _partial_row_to_dict
Expand Down Expand Up @@ -1238,7 +1238,7 @@ def test_with_timestamp(self):
self.assertEqual(result, expected_result)


class Test__filter_chain_helper(unittest2.TestCase):
class Test__filter_chain_helper(unittest.TestCase):

def _callFUT(self, *args, **kwargs):
from gcloud.bigtable.happybase.table import _filter_chain_helper
Expand Down Expand Up @@ -1348,7 +1348,7 @@ def test_with_all_options(self):
timestamp=timestamp)


class Test__columns_filter_helper(unittest2.TestCase):
class Test__columns_filter_helper(unittest.TestCase):

def _callFUT(self, *args, **kwargs):
from gcloud.bigtable.happybase.table import _columns_filter_helper
Expand Down Expand Up @@ -1396,7 +1396,7 @@ def test_column_and_column_families(self):
self.assertEqual(filter2b.regex, col_qual2.encode('utf-8'))


class Test__row_keys_filter_helper(unittest2.TestCase):
class Test__row_keys_filter_helper(unittest.TestCase):

def _callFUT(self, *args, **kwargs):
from gcloud.bigtable.happybase.table import _row_keys_filter_helper
Expand Down
Loading