Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# CHANGELOG

## v0.1.0 (2025-08-25)
## v0.1.0 (2025-08-26)

**Initial Release**

Expand Down
39 changes: 36 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ it ignores formatting differences and focuses on semantic equivalence.
- **Secure parsing**: Uses secure XML parsing practices by default
- **Test-friendly**: Perfect for `pytest`, `unittest`, and other testing frameworks

## Installation (IN PROGRESS)
## Installation

```bash
pip install xmlassert
Expand All @@ -24,7 +24,7 @@ pip install xmlassert
``` python
from xmlassert import assert_xml_equal

# These will pass (formatting differences ignored)
# These will pass (formatting differences are ignored)
assert_xml_equal("<root><a>text</a></root>", "<root>\n <a>text</a>\n</root>")

# This will fail with a clean diff
Expand All @@ -45,7 +45,7 @@ except AssertionError as e:
``` python
from xmlassert import assert_xml_equal

# Passes - formatting differences ignored
# Passes - formatting differences are ignored
xml1 = "<root><element>value</element></root>"
xml2 = """
<root>
Expand Down Expand Up @@ -108,3 +108,36 @@ Instead of the unreadable:
```
AssertionError: XML mismatch: <root><element>expected value</element></root> != <root><element>actual value</element></root>
```

## Troubleshooting

### Namespace Handling
XML namespaces are compared strictly.
Ensure your XML uses consistent namespace declarations.

### Large XML Documents
For very large documents, consider using dedicated XML diff tools.
`xmlassert` is optimized for test-sized XML snippets.

### Encoding Issues
Ensure both XML strings use the same encoding (UTF-8 recommended).


## Why xmlassert?

Compared to other XML testing approaches:

| Feature | `xmlassert` | `xml.etree` | `xmlunit` | string compare |
|---------|-----------|-------------|-----------|----------------|
| Human-readable diffs | Yes | No | Partial | No |
| Formatting-agnostic | Yes | No | Yes | No |
| Easy to use | Yes | Partial | Partial | Yes |
| Secure parsing | Yes | Partial | Yes | No |


## Links

- [PyPI Package](https://pypi.org/project/xmlassert/)
- [Source Code](https://github.com/ivanovmg/xmlassert)
- [Issue Tracker](https://github.com/ivanovmg/xmlassert/issues)
- [Changelog](CHANGELOG.md)
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = 'setuptools.build_meta'

[project]
name = 'xmlassert'
version = '0.1.0rc4'
version = '0.1.0'
description = 'Human-readable XML comparison for testing with clean diff output'
readme = 'README.md'
requires-python = '>=3.8'
Expand All @@ -23,6 +23,7 @@ classifiers = [
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
'Topic :: Software Development :: Testing',
'Topic :: Text Processing :: Markup :: XML',
]
Expand Down