Skip to content

Conversation

@bdraco
Copy link
Member

@bdraco bdraco commented Apr 26, 2021

#339 with typing fixed

Fixes a regression caused by refactoring error in #331

@bdraco
Copy link
Member Author

bdraco commented Apr 26, 2021

Since github is being unhelpful with running the CI, I mirrored this PR here bdraco#2 to get a run

@bdraco bdraco changed the title fix #337 : do not create the socket if add_multicast_member failed (windows) Skip socket creation if add_multicast_member fails (windows) Apr 26, 2021
@codecov-commenter
Copy link

codecov-commenter commented Apr 28, 2021

Codecov Report

Merging #341 (0c3cea3) into master (fe94810) will increase coverage by 0.40%.
The diff coverage is 88.23%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #341      +/-   ##
==========================================
+ Coverage   91.08%   91.49%   +0.40%     
==========================================
  Files           2        2              
  Lines        2671     2681      +10     
  Branches      360      362       +2     
==========================================
+ Hits         2433     2453      +20     
+ Misses        161      149      -12     
- Partials       77       79       +2     
Impacted Files Coverage Δ
zeroconf/__init__.py 89.01% <71.42%> (+0.66%) ⬆️
zeroconf/test.py 94.88% <100.00%> (+0.03%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fe94810...0c3cea3. Read the comment docs.

@bdraco
Copy link
Member Author

bdraco commented Apr 28, 2021

These lines are uncovered now so not a new issue, but given this regressed, I could create tests that mock the socket.error failure conditions with patch.object on listen_socket being passed to add_multicast_member if that seems like a good idea?

@bdraco
Copy link
Member Author

bdraco commented Apr 28, 2021

Will pick this back up tomorrow as its late late here.

@jstasiak
Copy link
Collaborator

These lines are uncovered now so not a new issue, but given this regressed, I could create tests that mock the socket.error failure conditions with patch.object on listen_socket being passed to add_multicast_member if that seems like a good idea?

I mean if you're felling like doing that I think it'll be nice to have. On a general note I think the whole socket-selecting layer needs to be separated from the rest of the code so that it can be unit tested nicely without any monkey patching etc. but that's more of a long-term plan.

@bdraco bdraco merged commit beccad1 into python-zeroconf:master May 3, 2021
@bdraco bdraco deleted the issues/337 branch May 3, 2021 06:16
@jstasiak
Copy link
Collaborator

jstasiak commented May 5, 2021

Version 0.30.0 has just been relased with this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants