]> granicus.if.org Git - python/commitdiff
Remove the test for the 'object' type -- it can no longer be
authorGuido van Rossum <guido@python.org>
Tue, 7 Aug 2001 16:53:42 +0000 (16:53 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 7 Aug 2001 16:53:42 +0000 (16:53 +0000)
instantiated.  (Its use as a base class is adequately tested by other
tests.)

Lib/test/test_descr.py

index 92f79d55985812ef009926adc931456de8aafa51..5b5f1370fb9f4353c494cbd900a9091f7b109c11 100644 (file)
@@ -472,29 +472,6 @@ def diamond():
     verify(G().boo() == "C")
     verify(G.__mro__ == (G, E, D, C, B, A, object))
 
-def objects():
-    if verbose: print "Testing object class..."
-    a = object()
-    verify(a.__class__ == object == type(a))
-    b = object()
-    verify(a is not b)
-    verify(not hasattr(a, "foo"))
-    try:
-        a.foo = 12
-    except TypeError:
-        pass
-    else:
-        verify(0, "object() should not allow setting a foo attribute")
-    verify(not hasattr(object(), "__dict__"))
-
-    class Cdict(object):
-        pass
-    x = Cdict()
-    verify(x.__dict__ is None)
-    x.foo = 1
-    verify(x.foo == 1)
-    verify(x.__dict__ == {'foo': 1})
-
 def slots():
     if verbose: print "Testing __slots__..."
     class C0(object):
@@ -812,7 +789,6 @@ def all():
     pymods()
     multi()
     diamond()
-    objects()
     slots()
     dynamics()
     errors()