mirror of
https://github.com/python/cpython.git
synced 2025-10-29 01:22:59 +00:00
Remove the test for the 'object' type -- it can no longer be
instantiated. (Its use as a base class is adequately tested by other tests.)
This commit is contained in:
parent
f040ede6e8
commit
15d86c6297
1 changed files with 0 additions and 24 deletions
|
|
@ -472,29 +472,6 @@ def diamond():
|
||||||
verify(G().boo() == "C")
|
verify(G().boo() == "C")
|
||||||
verify(G.__mro__ == (G, E, D, C, B, A, object))
|
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():
|
def slots():
|
||||||
if verbose: print "Testing __slots__..."
|
if verbose: print "Testing __slots__..."
|
||||||
class C0(object):
|
class C0(object):
|
||||||
|
|
@ -812,7 +789,6 @@ def all():
|
||||||
pymods()
|
pymods()
|
||||||
multi()
|
multi()
|
||||||
diamond()
|
diamond()
|
||||||
objects()
|
|
||||||
slots()
|
slots()
|
||||||
dynamics()
|
dynamics()
|
||||||
errors()
|
errors()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue