lincolnloop / python-qrcode

Python QR Code image generator
https://pypi.python.org/pypi/qrcode
Other
4.39k stars 673 forks source link

Add buffer and fileno for mocked sys.stdout #364

Closed arkamar closed 6 days ago

arkamar commented 3 months ago

This PR tries to fix two failing tests, test_factory and test_pipe, reported in https://github.com/lincolnloop/python-qrcode/issues/355 and https://github.com/lincolnloop/python-qrcode/issues/361. The issue seems to be related to mocked sys.stdout because the mocked object is probably missing certain attributes or methods that need to be emulated.

Both tests start to work for me again with this change.

glaubitz commented 3 months ago

I can confirm that this patch fixes the testsuite for me.