mirror of
https://github.com/python/cpython.git
synced 2025-11-09 22:16:39 +00:00
Test for the fix I just checked in to moduleobject.c.
Bugfix candidate.
This commit is contained in:
parent
cd637aae56
commit
d70356729f
1 changed files with 12 additions and 0 deletions
|
|
@ -2730,6 +2730,17 @@ def deepcopyrecursive():
|
||||||
b.a = a
|
b.a = a
|
||||||
z = deepcopy(a) # This blew up before
|
z = deepcopy(a) # This blew up before
|
||||||
|
|
||||||
|
def modules():
|
||||||
|
if verbose: print "Testing uninitialized module objects..."
|
||||||
|
from types import ModuleType as M
|
||||||
|
m = M.__new__(M)
|
||||||
|
str(m)
|
||||||
|
vereq(hasattr(m, "__name__"), 0)
|
||||||
|
vereq(hasattr(m, "__file__"), 0)
|
||||||
|
vereq(hasattr(m, "foo"), 0)
|
||||||
|
vereq(m.__dict__, None)
|
||||||
|
m.foo = 1
|
||||||
|
vereq(m.__dict__, {"foo": 1})
|
||||||
|
|
||||||
def test_main():
|
def test_main():
|
||||||
class_docstrings()
|
class_docstrings()
|
||||||
|
|
@ -2786,6 +2797,7 @@ def test_main():
|
||||||
hashinherit()
|
hashinherit()
|
||||||
strops()
|
strops()
|
||||||
deepcopyrecursive()
|
deepcopyrecursive()
|
||||||
|
modules()
|
||||||
if verbose: print "All OK"
|
if verbose: print "All OK"
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue