xmlunittest
Library using lxml and unittest for unit testing XML.
Decision gist · record as of 2026-08-14
Yes, if you generate XML and use unittest. The package is stable, has no known vulnerabilities, and low install friction. Dormant maintenance is a minor concern—it suggests no active development, but the core functionality is straightforward and unlikely to break. Use it when string-based XML comparison would be fragile or unreadable.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires lxml to be installed; lxml has C dependencies that may need compilation on some platforms.
- Low friction: pure Python wheel with a single runtime dependency on lxml.
- Maintenance is dormant (762 days since last release) but the repository is not archived and the package is marked Production/Stable.
License · maintenance · safety
MIT (permissive) — MIT license is permissive; you can use this package freely in commercial and private projects with minimal restrictions.
last release 2024-07-13 (762 days) · last repo commit 2024-07-13 · 16 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 1,001,212 downloads/mo, #4,537 on PyPI
Alternatives
Verify before relying
from xmlunittest import XmlTestCase
class MyTest(XmlTestCase):
def test_xml(self):
data = b'<?xml version="1.0"?><root><item id="1"/></root>'
root = self.assertXmlDocument(data)
self.assertXpathValues(root, './item/@id', ('1',))- Whether the package works with Python 3.13+ (classifiers list only up to 3.12)
- Whether dormant maintenance status affects real-world bug fixes or security updates going forward
What it is and what it does
xmlunittest is a TestCase subclass that adds assertion methods for validating XML documents as structured data rather than raw strings. It uses lxml and XPath to let you write tests that check namespaces, element values, attribute presence, and document structure without being brittle to formatting changes or attribute reordering.
You extend XmlTestCase, call assertXmlDocument() to parse your XML, then use methods like assertXpathValues(), assertXmlNamespace(), and assertXpathsUniqueValue() to validate specific parts of the tree. This is useful when your code generates XML and you want tests that survive cosmetic changes to the output while still catching structural problems.
Use it for
- Test XML output from code that generates configuration files, RSS feeds, or SOAP responses without brittle string comparisons.
- Validate that XML documents conform to expected namespaces and element structures using XPath queries.
- Check that optional XML elements and attributes are present or absent as expected in unit tests.
- Ensure attribute values match a set of allowed options across multiple elements in a single assertion.
- Verify uniqueness constraints on XML attributes across a document tree using XPath expressions.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you generate XML and use unittest.
The package is stable, has no known vulnerabilities, and low install friction. Dormant maintenance is a minor concern—it suggests no active development, but the core functionality is straightforward and unlikely to break. Use it when string-based XML comparison would be fragile or unreadable.
Install
xmlunittest on PyPI
Before you install
Low friction: pure Python wheel with a single runtime dependency on lxml. Maintenance is dormant (762 days since last release) but the repository is not archived and the package is marked Production/Stable.
Requires lxml to be installed; lxml has C dependencies that may need compilation on some platforms.
License in practice
MIT license is permissive; you can use this package freely in commercial and private projects with minimal restrictions.
Quickstart
from xmlunittest import XmlTestCase
class MyTest(XmlTestCase):
def test_xml(self):
data = b'<?xml version="1.0"?><root><item id="1"/></root>'
root = self.assertXmlDocument(data)
self.assertXpathValues(root, './item/@id', ('1',))
Verify before relying
- Whether the package works with Python 3.13+ (classifiers list only up to 3.12)
- Whether dormant maintenance status affects real-world bug fixes or security updates going forward
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.8 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagelxml |
| Maintenance | Dormant 762 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,001,212 / month, #4,537 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableFramework :: PytestIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: Quality AssuranceTopic :: Software Development :: TestingTopic :: Software Development :: Testing :: UnitTopic :: Text Processing :: Markup :: XML |
Evidence: xmlunittest-1.0.1-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “xml unit testing”
- xmlunittestExtends Python's unittest framework to compare XML documents…
- pookpook intercepts and mocks HTTP traffic for testing, supporting…
- flake8-formatter-junit-xmlFormats flake8 linting output as JUnit XML, enabling integration with…
Give your agent the search over MCP, or paste the wish link into any chat.
More Testing packages
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.
virtualenv creates isolated Python environments where packages can be installed independently without affecting the system Python or other projects.
Coverage.py measures which lines of Python code are executed during test runs, reporting coverage percentages and identifying untested code paths.
Install it if you want to measure test completeness or enforce coverage thresholds in your project.
pytest-asyncio is a pytest plugin that enables writing and running async test functions using the asyncio library, allowing developers to await code directly within test cases.
Install it if you write tests for any asyncio-based code.
A pytest plugin that generates test reports in Common Test Report Format (CTRF) as JSON, compatible with pytest-xdist and pytest-playwright for distributed and browser-based testing.
Install it if you need CTRF-formatted test output for CI/CD integration or cross-tool reporting.
See also lxml · et-xmlfile · xunitparser · xmldiff · xsdata · testtools · saxonche · unittest-xml-reporting · elementpath · xmlrunner