]> granicus.if.org Git - python/commitdiff
Fix an absurdly invasive test.
authorJeremy Hylton <jeremy@alum.mit.edu>
Fri, 3 Aug 2007 21:03:02 +0000 (21:03 +0000)
committerJeremy Hylton <jeremy@alum.mit.edu>
Fri, 3 Aug 2007 21:03:02 +0000 (21:03 +0000)
Checks that an io object somewhere in the stack of wrappers is
actually closed.  --This line, and those below, will be ignored--

M    test_urllib2net.py

Lib/test/test_urllib2net.py

index 17b53949df006b3a5edeb245766e5ce076383f97..02d69cfabc76d22f13998301e352756b738b24c7 100644 (file)
@@ -75,11 +75,9 @@ class CloseSocketTest(unittest.TestCase):
         # delve deep into response to fetch socket._socketobject
         response = urllib2.urlopen("http://www.python.org/")
         abused_fileobject = response.fp
-        self.assert_(abused_fileobject.__class__ is socket._fileobject)
-        httpresponse = abused_fileobject._sock
+        httpresponse = abused_fileobject.raw
         self.assert_(httpresponse.__class__ is httplib.HTTPResponse)
         fileobject = httpresponse.fp
-        self.assert_(fileobject.__class__ is socket._fileobject)
 
         self.assert_(not fileobject.closed)
         response.close()