Closed clebergnu closed 3 weeks ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 54.45%. Comparing base (
fe11714
) to head (bf9b3d5
). Report is 7 commits behind head on master.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
The current mock method on the two tests modified here do not support the context manager pattern. Let's use the standard library support for mocking open that supports it.
This is needed for future lint check improvements that will enforce the use of open() as a context manager to avoid leaking resources.
The test_set_idle_state_withsetstate() test has a significant change of behavior: one io.BytesIO instance was used for the writes that, in real life, would happen on two different files. The proposed change brings a more realistic, with a single write to a single file (although it only checks half of the values now). Still, I believe this is an improvement, including the extra check for the file that was actually written to.
Reference: https://docs.python.org/3/library/unittest.mock.html#mock-open