Code

Ticket #7339: django.diff

File django.diff, 1.7 KB (added by fijal, 6 years ago)
Line 
1diff -U3 -r -x .svn /home/fijal/load/django-trunk/tests/regressiontests/dispatch/tests/test_dispatcher.py tests/regressiontests/dispatch/tests/test_dispatcher.py
2--- /home/fijal/load/django-trunk/tests/regressiontests/dispatch/tests/test_dispatcher.py       2008-03-17 14:32:31.000000000 +0100
3+++ tests/regressiontests/dispatch/tests/test_dispatcher.py     2008-05-30 21:02:41.000000000 +0200
4@@ -2,6 +2,7 @@
5 from django.dispatch import dispatcher, robust
6 import unittest
7 import copy
8+import gc
9 
10 def x(a):
11     return a
12@@ -21,10 +22,11 @@
13     
14     def setUp(self):
15         # track the initial state, since it's possible that others have bleed receivers in
16+        gc.collect()
17         self.sendersBack = copy.copy(dispatcher.sendersBack)
18         self.connections = copy.copy(dispatcher.connections)
19         self.senders = copy.copy(dispatcher.senders)
20-   
21+
22     def _testIsClean(self):
23         """Assert that everything has been cleaned up automatically"""
24         self.assertEqual(dispatcher.sendersBack, self.sendersBack)
25@@ -86,6 +88,7 @@
26         connect(a.a, signal, b)
27         expected = []
28         del a
29+        gc.collect()
30         result = send('this',b, a=b)
31         self.assertEqual(result, expected)
32         self.assertEqual(list(getAllReceivers(b,signal)), [])
33@@ -101,6 +104,7 @@
34         connect(a, signal, b)
35         expected = []
36         del a
37+        gc.collect()
38         result = send('this',b, a=b)
39         self.assertEqual(result, expected)
40         self.assertEqual(list(getAllReceivers(b,signal)), [])
41@@ -123,6 +127,7 @@
42         del a
43         del b
44         del result
45+        gc.collect()
46         self._testIsClean()
47     
48     def testRobust(self):