Skip to content

Add test with pyzbar, to use external library to validate rendered barcodes - #256

Open
rejjen wants to merge 3 commits into
WhyNotHugo:mainfrom
rejjen:test_with_pyzbar
Open

rejjen wants to merge 3 commits into
WhyNotHugo:mainfrom
rejjen:test_with_pyzbar

Conversation

@rejjen

@rejjen rejjen commented Jan 7, 2026

Copy link
Copy Markdown

This is attempt to handle #181.

Requires Pillow and pyzbar to do any testing, but should gracefully skip if not installed
Requires cairosvg to test svg rendered, but also gracefully skip.

They should install with pip install .[test_with_pyzbar]

@WhyNotHugo WhyNotHugo left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the changes to barcode/isxn.py related?

Comment thread tests/test_with_pyzbar.py Resolved
Comment thread pyproject.toml Outdated

[project.optional-dependencies]
images = ["pillow"]
test_with_pyzbar = ["pillow", "cairosvg", "pyzbar"]

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use dependency groups for these:

[dependency-groups]
test = ["pillow", "cairosvg", "pyzbar"]
``
@rejjen

rejjen commented Mar 8, 2026

Copy link
Copy Markdown
Author

Are the changes to barcode/isxn.py related?

Yes, without changes validation will fail for tests/test_with_pyzbar.py::test_imagewriter - AssertionError: ISSN failed to decode.

There is some overlap with PR #255

@WhyNotHugo

Copy link
Copy Markdown
Owner

Merge conflicts need resolution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants