diff options
author | Gregory P. Smith <greg@mad-scientist.com> | 2007-08-29 05:06:13 (GMT) |
---|---|---|
committer | Gregory P. Smith <greg@mad-scientist.com> | 2007-08-29 05:06:13 (GMT) |
commit | e14841c19e284d05643370560d9d1b07ad87e658 (patch) | |
tree | d7249ae9a2cfd455c2461e852216e328146fa402 /Lib/bsddb/test | |
parent | a74184eb1d1ed8c1c139ea692b6037a7563d5540 (diff) | |
download | cpython-e14841c19e284d05643370560d9d1b07ad87e658.zip cpython-e14841c19e284d05643370560d9d1b07ad87e658.tar.gz cpython-e14841c19e284d05643370560d9d1b07ad87e658.tar.bz2 |
strings vs bytes, bytes wins again
Diffstat (limited to 'Lib/bsddb/test')
-rw-r--r-- | Lib/bsddb/test/test_compare.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/bsddb/test/test_compare.py b/Lib/bsddb/test/test_compare.py index d49aab7..0a57590 100644 --- a/Lib/bsddb/test/test_compare.py +++ b/Lib/bsddb/test/test_compare.py @@ -26,9 +26,9 @@ def make_reverse_comparator (cmp): return - delegate (left, right) return reverse -_expected_lexical_test_data = [bytes(_) for _ in +_expected_lexical_test_data = [s.encode('ascii') for s in ('', 'CCCP', 'a', 'aaa', 'b', 'c', 'cccce', 'ccccf')] -_expected_lowercase_test_data = [bytes(_) for _ in +_expected_lowercase_test_data = [s.encode('ascii') for s in ('', 'a', 'aaa', 'b', 'c', 'CC', 'cccce', 'ccccf', 'CCCP')] class ComparatorTests (unittest.TestCase): @@ -73,7 +73,7 @@ class AbstractBtreeKeyCompareTestCase (unittest.TestCase): def addDataToDB (self, data): i = 0 for item in data: - self.db.put (item, str (i)) + self.db.put (item, str(i).encode("ascii")) i = i + 1 def createDB (self, key_comparator): @@ -181,7 +181,7 @@ class BtreeExceptionsTestCase (AbstractBtreeKeyCompareTestCase): sys.stderr = stdErr errorOut = temp.getvalue() if not successRe.search(errorOut): - self.fail("unexpected stderr output:\n"+errorOut) + self.fail("unexpected stderr output: %r" % errorOut) def _test_compare_function_exception (self): self.startTest () |