1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
#
# Copyright (c) 2016 - 2024 -- Lars Heuer
# All rights reserved.
#
# License: BSD License
#
"""\
Tests plugin loading.
"""
import pytest
import segno
def test_noplugin():
qr = segno.make('The Beatles')
with pytest.raises(AttributeError):
qr.to_unknown_plugin()
def test_plugin():
try:
import qrcode_artistic
qr = segno.make('The Beatles')
assert qr.to_pil() is not None
except:
print("The module qrcode_artistic is not installed; the test is skipped.")
if __name__ == '__main__':
pytest.main([__file__])
|