kplindegaard / smbus2

A drop-in replacement for smbus-cffi/smbus-python in pure Python
MIT License
243 stars 68 forks source link

tests: start and stop mocking in setUp and tearDown #92

Closed markmentovai closed 1 year ago

markmentovai commented 1 year ago

This is a better fix for #87 than the part of 5ddc381278a2285703bfaa5d33e7ad46bbea7841 that removed a valid assertion. The assertion was fine for the code under test, but the mocks were outliving their usefulness by not being stopped after the conclusion of the test, and remained in effect for code not under test where they caused harm.

Cc @hramrach

sonarcloud[bot] commented 1 year ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

kplindegaard commented 1 year ago

Thanks and I fully agree. 😃 This should go in.

kplindegaard commented 1 year ago

Test pipeline issues for Python 2.7 irrelevant for the sanity of this PR, so it's approved and good for merge.