diff --git a/oslotest/__init__.py b/oslotest/__init__.py index e3f05f9..e69de29 100644 --- a/oslotest/__init__.py +++ b/oslotest/__init__.py @@ -1,16 +0,0 @@ -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -import six - - -six.add_move(six.MovedModule('mock', 'mock', 'unittest.mock')) diff --git a/oslotest/createfile.py b/oslotest/createfile.py index 86fa8b2..8f5b98f 100644 --- a/oslotest/createfile.py +++ b/oslotest/createfile.py @@ -14,7 +14,6 @@ import os import tempfile import fixtures -import six class CreateFileWithContent(fixtures.Fixture): @@ -56,7 +55,7 @@ class CreateFileWithContent(fixtures.Fixture): def setUp(self): super(CreateFileWithContent, self).setUp() contents = self._contents - if isinstance(contents, six.text_type): + if isinstance(contents, str): contents = contents.encode(self._encoding) if not os.path.isabs(self._filename): (fd, self.path) = tempfile.mkstemp(prefix=self._filename, diff --git a/oslotest/tests/__init__.py b/oslotest/tests/__init__.py index e3f05f9..e69de29 100644 --- a/oslotest/tests/__init__.py +++ b/oslotest/tests/__init__.py @@ -1,16 +0,0 @@ -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -import six - - -six.add_move(six.MovedModule('mock', 'mock', 'unittest.mock')) diff --git a/oslotest/tests/unit/test_base.py b/oslotest/tests/unit/test_base.py index 63c66b6..8a39c34 100644 --- a/oslotest/tests/unit/test_base.py +++ b/oslotest/tests/unit/test_base.py @@ -20,7 +20,6 @@ import unittest from unittest import mock import fixtures -import six import testtools from oslotest import base @@ -142,7 +141,7 @@ class TestTempFiles(base.BaseTestCase): self.assertEqual(1, len(temps)) with open(temps[0], 'rb') as f: contents = f.read() - self.assertEqual('ಠ_ಠ', six.text_type(contents, encoding='utf-8')) + self.assertEqual('ಠ_ಠ', str(contents, encoding='utf-8')) def test_create_unicode_files_encoding(self): files = [["embarrassed", '⊙﹏⊙', 'utf-8']] @@ -150,7 +149,7 @@ class TestTempFiles(base.BaseTestCase): self.assertEqual(1, len(temps)) with open(temps[0], 'rb') as f: contents = f.read() - self.assertEqual('⊙﹏⊙', six.text_type(contents, encoding='utf-8')) + self.assertEqual('⊙﹏⊙', str(contents, encoding='utf-8')) def test_create_unicode_files_multi_encoding(self): files = [ @@ -162,10 +161,9 @@ class TestTempFiles(base.BaseTestCase): for i, (basename, raw_contents, raw_encoding) in enumerate(files): with open(temps[i], 'rb') as f: contents = f.read() - if not isinstance(raw_contents, six.text_type): - raw_contents = six.text_type(raw_contents, - encoding=raw_encoding) - self.assertEqual(six.text_type(contents, encoding=raw_encoding), + if not isinstance(raw_contents, str): + raw_contents = str(raw_contents, encoding=raw_encoding) + self.assertEqual(str(contents, encoding=raw_encoding), raw_contents) def test_create_bad_encoding(self): diff --git a/oslotest/tests/unit/test_createfile.py b/oslotest/tests/unit/test_createfile.py index c16d409..15b37c6 100644 --- a/oslotest/tests/unit/test_createfile.py +++ b/oslotest/tests/unit/test_createfile.py @@ -16,8 +16,6 @@ import os -import six - from oslotest import base from oslotest import createfile @@ -32,7 +30,7 @@ class CreateFileWithContentTest(base.BaseTestCase): f.setUp() with open(f.path, 'rb') as f: contents = f.read() - self.assertEqual('ಠ_ಠ', six.text_type(contents, encoding='utf-8')) + self.assertEqual('ಠ_ಠ', str(contents, encoding='utf-8')) def test_create_unicode_files_encoding(self): f = createfile.CreateFileWithContent( @@ -41,7 +39,7 @@ class CreateFileWithContentTest(base.BaseTestCase): f.setUp() with open(f.path, 'rb') as f: contents = f.read() - self.assertEqual('⊙﹏⊙', six.text_type(contents, encoding='utf-8')) + self.assertEqual('⊙﹏⊙', str(contents, encoding='utf-8')) def test_create_bad_encoding(self): f = createfile.CreateFileWithContent( diff --git a/requirements.txt b/requirements.txt index 32baed1..81463cc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,8 +1,3 @@ -# The order of packages is significant, because pip processes them in the order -# of appearance. Changing the order has an impact on the overall integration -# process, which may cause wedges in the gate later. - fixtures>=3.0.0 # Apache-2.0/BSD python-subunit>=1.0.0 # Apache-2.0/BSD -six>=1.10.0 # MIT testtools>=2.2.0 # MIT diff --git a/tox.ini b/tox.ini index 998a759..36c84ef 100644 --- a/tox.ini +++ b/tox.ini @@ -41,7 +41,3 @@ commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasen [flake8] show-source = true exclude = .tox,dist,doc,*.egg,build - -[hacking] -import_exceptions = - six.moves.mock