diff options
author | Tim Peters <tim.peters@gmail.com> | 2001-08-16 16:56:16 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2001-08-16 16:56:16 (GMT) |
commit | 63a8d694768b48e67138f7de85d9acf590847560 (patch) | |
tree | 27f798e12c8561e13f222fafc590741bbbd9437d /Lib | |
parent | 2f7045576d46eeee19258cb50c72b8edd25f299f (diff) | |
download | cpython-63a8d694768b48e67138f7de85d9acf590847560.zip cpython-63a8d694768b48e67138f7de85d9acf590847560.tar.gz cpython-63a8d694768b48e67138f7de85d9acf590847560.tar.bz2 |
Repair some accidents causing Windows failures:
+ test_compare. While None compares less than anything else, it's not
always the case that None has the smallest id().
+ test_descr. The output of %p (pointer) formats varies across platforms.
In particular, on Windows it doesn't produce a leading "0x".
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_compare.py | 2 | ||||
-rw-r--r-- | Lib/test/test_descr.py | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/Lib/test/test_compare.py b/Lib/test/test_compare.py index 1d8b947..bc833ea 100644 --- a/Lib/test/test_compare.py +++ b/Lib/test/test_compare.py @@ -45,7 +45,7 @@ def test(): else: print "%s != %s" % (a, b) # Ensure default comparison compares id() of args - L = [None] + L = [] for i in range(10): L.insert(len(L)/2, Empty()) for a in L: diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py index 51a8a40..69ec66a 100644 --- a/Lib/test/test_descr.py +++ b/Lib/test/test_descr.py @@ -881,8 +881,8 @@ def specials(): verify(c1 != c2) verify(not c1 != c1) verify(not c1 == c2) - verify(str(c1) == '<C object at 0x%x>' % id(c1)) - verify(repr(c1) == '<C object at 0x%x>' % id(c1)) + verify(str(c1).startswith('<C object at ')) + verify(str(c1) == repr(c1)) verify(-1 not in c1) for i in range(10): verify(i in c1) @@ -902,8 +902,8 @@ def specials(): verify(d1 != d2) verify(not d1 != d1) verify(not d1 == d2) - verify(str(d1) == '<D object at 0x%x>' % id(d1)) - verify(repr(d1) == '<D object at 0x%x>' % id(d1)) + verify(str(d1).startswith('<D object at ')) + verify(str(d1) == repr(d1)) verify(-1 not in d1) for i in range(10): verify(i in d1) |