Remove six

This library no longer supports python 2 thus usage of six is no longer
needed.

Change-Id: Id114f020916e52bf1588c8679bfd7df776b1c702
This commit is contained in:
Takashi Kajinami 2024-02-08 17:50:28 +09:00
parent 39aa29f8af
commit 61e4defcf7
3 changed files with 5 additions and 7 deletions

View File

@ -23,7 +23,6 @@ from unittest.mock import patch
from ddt import data
from ddt import ddt
from ddt import unpack
import six
from os_testr import subunit_trace
from os_testr.tests import base
@ -89,7 +88,7 @@ class TestSubunitTrace(base.TestCase):
'sample_streams/successful.subunit')
bytes_ = io.BytesIO()
with open(regular_stream, 'rb') as stream:
bytes_.write(six.binary_type(stream.read()))
bytes_.write(bytes(stream.read()))
bytes_.seek(0)
stdin = io.TextIOWrapper(io.BufferedReader(bytes_))
returncode = subunit_trace.trace(stdin, sys.stdout)

View File

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import six
import io
import sys
from ddt import data
@ -34,7 +34,7 @@ class TestNullColorizer(base.TestCase):
@data(("foo", "red"), ("foo", "bar"))
@unpack
def test_write_string_ignore_color(self, text, color):
output = six.StringIO()
output = io.StringIO()
c = colorizer.NullColorizer(output)
c.write(text, color)
self.assertEqual(text, output.getvalue())
@ -62,7 +62,7 @@ class TestAnsiColorizer(base.TestCase):
@data(("foo", "red", "31"), ("foo", "blue", "34"))
@unpack
def test_write_string_valid_color(self, text, color, color_code):
output = six.StringIO()
output = io.StringIO()
c = colorizer.AnsiColorizer(output)
c.write(text, color)
self.assertIn(text, output.getvalue())
@ -71,6 +71,6 @@ class TestAnsiColorizer(base.TestCase):
@data(("foo", None), ("foo", "invalid_color"))
@unpack
def test_write_string_invalid_color(self, text, color):
output = six.StringIO()
output = io.StringIO()
c = colorizer.AnsiColorizer(output)
self.assertRaises(KeyError, c.write, text, color)

View File

@ -9,4 +9,3 @@ oslotest>=3.2.0 # Apache-2.0
stestr>=1.0.0 # Apache-2.0
testscenarios>=0.4 # Apache-2.0/BSD
ddt>=1.0.1 # MIT
six>=1.10.0 # MIT