On Wed, 3 Jun 2026 at 20:48, Daniel Sahlberg <[email protected]> wrote:
> Den ons 3 juni 2026 kl 03:09 skrev Branko Čibej <[email protected]>: > > [...] > Given that we currently have 3 tests that produce invalid XML, and we >> didn't even know about it until I added XML validation, I think we should >> go the other way: make the XML output validation in tests mandatory and >> default unless explicitly disabled during the test run. Right now, we're >> breaking our own API contract. >> >> "Let's not test because it's not convenient" is not an attitude that I >> can support. >> > > I agree that we should test it but I also feel a bit uncomfortable seeing > the test suite download something from the internet. > > I don't see a problem if the test suite fail by default if lxml (or other > dependencies) isn't installed beforehand. I think it would be perfectly > fine to require someone running the test suite to actually install > dependencies on their system. Of course we should then document the > required modules in INSTALL, I'm happy to help doing that. > > This approach sounds good to me. As an option, I could create a branch that switches to using the installed lxml and either skips or fails the tests otherwise. Having a branch like this might help in moving things forward, if there's rough consensus that it is on the list of possible options. Another potential way forward would be to drop full XML schema validation in favor of simply parsing the XML using the built-in Python XML parser to check its structural validity. This would still catch the cases where we produce entirely invalid XML and can be done without third-party dependencies. -- Ivan Zhakov

