@@ -794,51 +794,6 @@ def test_nsattrs_wattr(self):
794794 self .assertEqual (attrs .getQNameByName ((ns_uri , "attr" )), "ns:attr" )
795795
796796
797- # During the development of Python 2.5, an attempt to move the "xml"
798- # package implementation to a new package ("xmlcore") proved painful.
799- # The goal of this change was to allow applications to be able to
800- # obtain and rely on behavior in the standard library implementation
801- # of the XML support without needing to be concerned about the
802- # availability of the PyXML implementation.
803- #
804- # While the existing import hackery in Lib/xml/__init__.py can cause
805- # PyXML's _xmlpus package to supplant the "xml" package, that only
806- # works because either implementation uses the "xml" package name for
807- # imports.
808- #
809- # The move resulted in a number of problems related to the fact that
810- # the import machinery's "package context" is based on the name that's
811- # being imported rather than the __name__ of the actual package
812- # containment; it wasn't possible for the "xml" package to be replaced
813- # by a simple module that indirected imports to the "xmlcore" package.
814- #
815- # The following two tests exercised bugs that were introduced in that
816- # attempt. Keeping these tests around will help detect problems with
817- # other attempts to provide reliable access to the standard library's
818- # implementation of the XML support.
819-
820- def test_sf_1511497 (self ):
821- # Bug report: http://www.python.org/sf/1511497
822- import sys
823- old_modules = sys .modules .copy ()
824- for modname in list (sys .modules .keys ()):
825- if modname .startswith ("xml." ):
826- del sys .modules [modname ]
827- try :
828- import xml .sax .expatreader
829- module = xml .sax .expatreader
830- self .assertEqual (module .__name__ , "xml.sax.expatreader" )
831- finally :
832- sys .modules .update (old_modules )
833-
834- def test_sf_1513611 (self ):
835- # Bug report: http://www.python.org/sf/1513611
836- sio = StringIO ("invalid" )
837- parser = make_parser ()
838- from xml .sax import SAXParseException
839- self .assertRaises (SAXParseException , parser .parse , sio )
840-
841-
842797def test_main ():
843798 run_unittest (MakeParserTest ,
844799 SaxutilsTest ,
0 commit comments