diff --git a/nova/tests/functional/db/test_cell_mapping.py b/nova/tests/functional/db/test_cell_mapping.py index e77c1a994c78..118aa52edab9 100644 --- a/nova/tests/functional/db/test_cell_mapping.py +++ b/nova/tests/functional/db/test_cell_mapping.py @@ -30,7 +30,7 @@ class CellMappingTestCase(test.NoDBTestCase): sample_mapping = {'uuid': '', 'name': 'fake-cell', 'transport_url': 'rabbit:///', - 'database_connection': 'mysql:///'} + 'database_connection': 'mysql+pymysql:///'} def _create_mapping(self, **kwargs): args = self.sample_mapping.copy() diff --git a/nova/tests/unit/db/test_db_api.py b/nova/tests/unit/db/test_db_api.py index 6cf4fabfeb5e..a7ee5406c324 100644 --- a/nova/tests/unit/db/test_db_api.py +++ b/nova/tests/unit/db/test_db_api.py @@ -956,7 +956,7 @@ class SqlAlchemyDbApiNoDbTestCase(test.NoDBTestCase): def test_get_regexp_op_for_database_mysql(self): op = sqlalchemy_api._get_regexp_op_for_connection( - 'mysql://root@localhost') + 'mysql+pymysql://root@localhost') self.assertEqual('REGEXP', op) def test_get_regexp_op_for_database_postgresql(self): diff --git a/nova/tests/unit/objects/test_cell_mapping.py b/nova/tests/unit/objects/test_cell_mapping.py index 1046b8d75584..1a5fb12c245b 100644 --- a/nova/tests/unit/objects/test_cell_mapping.py +++ b/nova/tests/unit/objects/test_cell_mapping.py @@ -59,33 +59,33 @@ class _TestCellMappingObject(object): def test_create(self, create_in_db): uuid = uuidutils.generate_uuid() db_mapping = get_db_mapping(uuid=uuid, name='test', - database_connection='mysql:///') + database_connection='mysql+pymysql:///') create_in_db.return_value = db_mapping mapping_obj = objects.CellMapping(self.context) mapping_obj.uuid = uuid mapping_obj.name = 'test' - mapping_obj.database_connection = 'mysql:///' + mapping_obj.database_connection = 'mysql+pymysql:///' mapping_obj.create() create_in_db.assert_called_once_with(self.context, {'uuid': uuid, 'name': 'test', - 'database_connection': 'mysql:///'}) + 'database_connection': 'mysql+pymysql:///'}) self.compare_obj(mapping_obj, db_mapping) @mock.patch.object(cell_mapping.CellMapping, '_save_in_db') def test_save(self, save_in_db): uuid = uuidutils.generate_uuid() - db_mapping = get_db_mapping(database_connection='mysql:///') + db_mapping = get_db_mapping(database_connection='mysql+pymysql:///') save_in_db.return_value = db_mapping mapping_obj = objects.CellMapping(self.context) mapping_obj.uuid = uuid - mapping_obj.database_connection = 'mysql:///' + mapping_obj.database_connection = 'mysql+pymysql:///' mapping_obj.save() save_in_db.assert_called_once_with(self.context, uuid, {'uuid': uuid, - 'database_connection': 'mysql:///'}) + 'database_connection': 'mysql+pymysql:///'}) self.compare_obj(mapping_obj, db_mapping) @mock.patch.object(cell_mapping.CellMapping, '_destroy_in_db') diff --git a/test-requirements.txt b/test-requirements.txt index 147dc7b8fa21..465cb1c06128 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -8,7 +8,6 @@ discover fixtures>=1.3.1 mock>=1.0 mox3>=0.7.0 -MySQL-python;python_version=='2.7' psycopg2 PyMySQL>=0.6.2 # MIT License python-barbicanclient>=3.0.1 diff --git a/tools/db/schema_diff.py b/tools/db/schema_diff.py index bc145cf04aa7..ca393874f5bc 100755 --- a/tools/db/schema_diff.py +++ b/tools/db/schema_diff.py @@ -32,7 +32,7 @@ Run like: MYSQL: - ./tools/db/schema_diff.py mysql://root@localhost \ + ./tools/db/schema_diff.py mysql+pymysql://root@localhost \ master:latest my_branch:82 POSTGRESQL: