@@ -694,51 +694,6 @@ def test_nsattrs_wattr(self):
694694 self .assertEqual (attrs .getQNameByName ((ns_uri , "attr" )), "ns:attr" )
695695
696696
697- # During the development of Python 2.5, an attempt to move the "xml"
698- # package implementation to a new package ("xmlcore") proved painful.
699- # The goal of this change was to allow applications to be able to
700- # obtain and rely on behavior in the standard library implementation
701- # of the XML support without needing to be concerned about the
702- # availability of the PyXML implementation.
703- #
704- # While the existing import hackery in Lib/xml/__init__.py can cause
705- # PyXML's _xmlpus package to supplant the "xml" package, that only
706- # works because either implementation uses the "xml" package name for
707- # imports.
708- #
709- # The move resulted in a number of problems related to the fact that
710- # the import machinery's "package context" is based on the name that's
711- # being imported rather than the __name__ of the actual package
712- # containment; it wasn't possible for the "xml" package to be replaced
713- # by a simple module that indirected imports to the "xmlcore" package.
714- #
715- # The following two tests exercised bugs that were introduced in that
716- # attempt. Keeping these tests around will help detect problems with
717- # other attempts to provide reliable access to the standard library's
718- # implementation of the XML support.
719-
720- def test_sf_1511497 (self ):
721- # Bug report: http://www.python.org/sf/1511497
722- import sys
723- old_modules = sys .modules .copy ()
724- for modname in list (sys .modules .keys ()):
725- if modname .startswith ("xml." ):
726- del sys .modules [modname ]
727- try :
728- import xml .sax .expatreader
729- module = xml .sax .expatreader
730- self .assertEqual (module .__name__ , "xml.sax.expatreader" )
731- finally :
732- sys .modules .update (old_modules )
733-
734- def test_sf_1513611 (self ):
735- # Bug report: http://www.python.org/sf/1513611
736- sio = StringIO ("invalid" )
737- parser = make_parser ()
738- from xml .sax import SAXParseException
739- self .assertRaises (SAXParseException , parser .parse , sio )
740-
741-
742697def test_main ():
743698 run_unittest (MakeParserTest ,
744699 SaxutilsTest ,
0 commit comments