changeset 34:739c87de4667

added another gc test
author Atul Varma <avarma@mozilla.com>
date Mon, 10 May 2010 20:57:23 -0700
parents 056025f2c8ae
children 6ddc83bb61f8
files test_pydertron.py
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/test_pydertron.py	Mon May 10 20:55:42 2010 -0700
+++ b/test_pydertron.py	Mon May 10 20:57:23 2010 -0700
@@ -24,5 +24,15 @@
         gc.collect()
         self.assertEqual(wrt(), None)
 
+    def testGC2(self):
+        sandbox = pydertron.JsSandbox(pydertron.NullFileSystem())
+        sandbox.set_globals()
+        sandbox.run_script("var a = 1;")
+        wrt = weakref.ref(sandbox.rt)
+        sandbox.finish()
+        del sandbox
+        gc.collect()
+        self.assertEqual(wrt(), None)
+
 if __name__ == '__main__':
     unittest.main()