[Python-checkins] CVS: python/dist/src/Lib/test test_gc.py,1.2,1.3

Vladimir Marangozov python-dev@python.org
Sun, 6 Aug 2000 15:45:33 -0700


Update of /cvsroot/python/python/dist/src/Lib/test
In directory slayer.i.sourceforge.net:/tmp/cvs-serv25095/Lib/test

Modified Files:
	test_gc.py 
Log Message:
Neil Schemenauer: GC enable(), disable(), isenabled() interface.

Small stylistic changes by VM:
- is_enabled() -> isenabled()
- static ... Py_<func> -> static ... gc_<func>



Index: test_gc.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_gc.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** test_gc.py	2000/06/30 15:13:14	1.2
--- test_gc.py	2000/08/06 22:45:31	1.3
***************
*** 76,79 ****
--- 76,84 ----
  
  def test_all():
+ 
+     enabled = gc.isenabled()
+     gc.disable()
+     assert not gc.isenabled()
+ 
      test_list()
      test_dict()
***************
*** 84,87 ****
--- 89,99 ----
      test_finalizer()
      test_function()
+ 
+     # test gc.enable() even if GC is disabled by default
+     gc.enable()
+     assert gc.isenabled()
+     if not enabled:
+         gc.disable()
+ 
  
  test_all()