def METHOD_NAME(self):
    self.writer.config.no_namespace_schema_location = "foo.xsd"
    events = iter(
        [
            (XmlWriterEvent.START, "root"),
            (XmlWriterEvent.END, "root"),
        ]
    )
    self.writer.write(events)
    lines = self.writer.output.getvalue().splitlines()
    self.assertEqual(
        (
            '<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" '
            'xsi:noNamespaceSchemaLocation="foo.xsd"/>'
        ),
        lines[1],
    )