(self)
| 202 | self.check_parse(input) |
| 203 | |
| 204 | def test_parse_close_source(self): |
| 205 | builtin_open = open |
| 206 | fileobj = None |
| 207 | |
| 208 | def mock_open(*args): |
| 209 | nonlocal fileobj |
| 210 | fileobj = builtin_open(*args) |
| 211 | return fileobj |
| 212 | |
| 213 | with mock.patch('xml.sax.saxutils.open', side_effect=mock_open): |
| 214 | make_xml_file(self.data, 'iso-8859-1', None) |
| 215 | with self.assertRaises(SAXException): |
| 216 | self.check_parse(TESTFN) |
| 217 | self.assertTrue(fileobj.closed) |
| 218 | |
| 219 | def check_parseString(self, s): |
| 220 | from xml.sax import parseString |
nothing calls this directly
no test coverage detected