| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
Are the changes to barcode/isxn.py related?
Sorry, something went wrong.
| try: | ||
| import cairosvg | ||
| import cairocffi | ||
| cairocffi.Context(cairocffi.ImageSurface(cairocffi.FORMAT_ARGB32, 1, 1)) | ||
| HAS_CAIROSVG = True | ||
| except (ImportError, OSError): | ||
| HAS_CAIROSVG = False |
There was a problem hiding this comment.
I'd prefer for tests to outright fail; this skips them silently and it would be easy to miss that they're not running properly.
I have no objection to adding test-only dependencies; users won't be affected by these.
Sorry, something went wrong.
There was a problem hiding this comment.
It should mark tests as skipped I believe and provide reason if library is not loaded correctly.
https://github.com/WhyNotHugo/python-barcode/pull/256/changes#diff-2d1975a58b23083a3f9f1331cb6534c4e8da053b6f66b1c60a1c035ec035d79bR99
Similarly to pytest.importorskip above.
Sorry, something went wrong.
|
|
||
| [project.optional-dependencies] | ||
| images = ["pillow"] | ||
| test_with_pyzbar = ["pillow", "cairosvg", "pyzbar"] |
There was a problem hiding this comment.
Let's use dependency groups for these:
[dependency-groups] test = ["pillow", "cairosvg", "pyzbar"] ``
Sorry, something went wrong.
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 |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
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]