testtools-dev team mailing list archive
-
testtools-dev team
-
Mailing list archive
-
Message #00484
[Bug 675331] Re: testtools.tests.test_content.TestBytesContent.test_bytes fails on Python 3
** Changed in: testtools
Status: Fix Committed => Fix Released
--
You received this bug notification because you are a member of testtools
developers, which is subscribed to testtools.
https://bugs.launchpad.net/bugs/675331
Title:
testtools.tests.test_content.TestBytesContent.test_bytes fails on Python 3
Status in testtools:
Fix Released
Bug description:
A new test added in r128 seems to have exposed an existing Python 3 issue, and fails:
======================================================================
ERROR: testtools.tests.test_content.TestBytesContent.test_bytes
----------------------------------------------------------------------
Text attachment: traceback
------------
Traceback (most recent call last):
File "testtools\runtest.py", line 143, in _run_user
return fn(*args)
File "testtools\testcase.py", line 539, in _run_test_method
return self._get_test_method()()
File "testtools\tests\test_content.py", line 82, in test_bytes
self.assertEqual(expected, text_content(data))
File "testtools\testcase.py", line 309, in assertEqual
self.assertThat(observed, matcher)
File "testtools\testcase.py", line 373, in assertThat
mismatch = matcher.match(matchee)
File "testtools\matchers.py", line 192, in match
if self.comparator(other, self.expected):
File "testtools\content.py", line 34, in __eq__
''.join(self.iter_bytes()) == ''.join(other.iter_bytes()))
TypeError: sequence item 0: expected str instance, bytes found
------------
Can't be using str.join for bytes on Pythons where str is a unicode type.
References