Commits

Robert Brewer committed 95c9575

test_refleaks really shouldn't share its http conn across threads.

  • Participants
  • Parent commits b7b8790

Comments (0)

Files changed (1)

cherrypy/test/test_refleaks.py

 test.prefer_parent_path()
 
 import gc
+import httplib
 import threading
+
 import cherrypy
 from cherrypy import _cprequest
 
     
     def test_threadlocal_garbage(self):
         def getpage():
-            self.getPage('/')
-            self.assertBody("Hello world!")
+            if self.scheme == 'https':
+                c = httplib.HTTPSConnection('127.0.0.1:%s' % self.PORT)
+            else:
+                c = httplib.HTTPConnection('127.0.0.1:%s' % self.PORT)
+            try:
+                c.request('GET', '/')
+                resp = c.getresponse()
+                self.assertEqual(resp.status, 200)
+                self.assertEqual(resp.read(), "Hello world!")
+            finally:
+                c.close()
         
         ts = []
         for _ in range(25):