Fixture to create sockets, while tracking them for cleanup
(context, sockets)
| 135 | |
| 136 | @pytest.fixture |
| 137 | def socket(context, sockets): |
| 138 | """Fixture to create sockets, while tracking them for cleanup""" |
| 139 | |
| 140 | def new_socket(*args, **kwargs): |
| 141 | s = context.socket(*args, **kwargs) |
| 142 | sockets.append(s) |
| 143 | return s |
| 144 | |
| 145 | return new_socket |
| 146 | |
| 147 | |
| 148 | def assert_raises_errno(errno): |
no outgoing calls
no test coverage detected
searching dependent graphs…