pimoroni / i2cdevice-python

Domain-specific language for describing smbus/i2c register maps
MIT License
26 stars 14 forks source link

Add field name to ValueError raised by field adapter #4

Closed kklimek closed 5 years ago

Gadgetoid commented 5 years ago

The use of "f" string formatting is failing in both Python 2.7 and 3.5. You should swap this with "".format(), but otherwise this looks good! Thanks for raising a PR.

coveralls commented 5 years ago

Pull Request Test Coverage Report for Build 28


Files with Coverage Reduction New Missed Lines %
i2cdevice/init.py 2 97.33%
<!-- Total: 2 -->
Totals Coverage Status
Change from base Build 25: -0.9%
Covered Lines: 207
Relevant Lines: 212

💛 - Coveralls
Gadgetoid commented 5 years ago

Thank you! I'll add a test for this error case to stop Coveralls from complaining.

Gadgetoid commented 5 years ago

I wonder if this is worth adding to KeyError and IndexError too since it would make uncaught exceptions in i2cdevice a little more useful to end-users. 🤔