[Jython-checkins] jython: This ancient test is IMO fully covered by more modern testing.

frank.wierzbicki jython-checkins at python.org
Fri May 20 05:12:18 CEST 2011


http://hg.python.org/jython/rev/b7663d3b664b
changeset:   6228:b7663d3b664b
user:        Frank Wierzbicki <fwierzbicki at gmail.com>
date:        Thu May 19 14:42:43 2011 -0700
summary:
  This ancient test is IMO fully covered by more modern testing.

files:
  Lib/test/test_methods.py |  62 ----------------------------
  1 files changed, 0 insertions(+), 62 deletions(-)


diff --git a/Lib/test/test_methods.py b/Lib/test/test_methods.py
deleted file mode 100644
--- a/Lib/test/test_methods.py
+++ /dev/null
@@ -1,62 +0,0 @@
-# Python test set -- part 7, bound and unbound methods
-
-from test_support import *
-
-print 'Bound and unbound methods (test_methods.py)'
-
-class A:
-    def one(self): return 'one'
-
-class B(A):
-    def two(self): return 'two'
-
-class C(A):
-    def one(self): return 'another one'
-
-a = A()
-b = B()
-c = C()
-
-print 'unbound method equality'
-assert A.one == B.one
-assert A.one <> C.one
-
-print 'method attributes'
-assert A.one.im_func == a.one.im_func
-assert a.one.im_self == a
-assert a.one.im_class == A
-assert b.one.im_self == b
-assert b.one.im_class == B
-
-print 'unbound method invocation w/ explicit self'
-assert A.one(b) == 'one'
-assert B.two(b) == 'two'
-assert B.one(b) == 'one'
-
-assert A.one(c) == 'one'
-assert C.one(c) == 'another one'
-
-assert A.one(a) == 'one'
-try:
-    B.one(a)
-    assert 0
-except TypeError:
-    pass
-try:
-    C.one(a)
-    assert 0
-except TypeError:
-    pass
-
-print '"unbound" methods of builtin types'
-w = [1,2,3].append
-x = [4,5,6].append
-assert w <> x
-assert w.__self__ <> x.__self__
-
-y = w.__self__[:]
-z = x.__self__[:]
-
-assert y.append.__self__ <> w
-z.append(7)
-assert z == (x.__self__+[7])

-- 
Repository URL: http://hg.python.org/jython


More information about the Jython-checkins mailing list