()
| 198 | reason="windows-specific fakesocket testing", |
| 199 | ) |
| 200 | async def test_windows_functionality() -> None: |
| 201 | # mypy doesn't support a good way of aborting typechecking on different platforms |
| 202 | if sys.platform == "win32": # pragma: no branch |
| 203 | fn() |
| 204 | s1 = trio.socket.socket(type=trio.socket.SOCK_DGRAM) |
| 205 | s2 = trio.socket.socket(type=trio.socket.SOCK_DGRAM) |
| 206 | await s1.bind(("127.0.0.1", 0)) |
| 207 | with pytest.raises( |
| 208 | AttributeError, |
| 209 | match=r"^'FakeSocket' object has no attribute 'sendmsg'$", |
| 210 | ): |
| 211 | await s1.sendmsg([b"jkl"], (), 0, s2.getsockname()) # type: ignore[attr-defined] |
| 212 | with pytest.raises( |
| 213 | AttributeError, |
| 214 | match=r"^'FakeSocket' object has no attribute 'recvmsg'$", |
| 215 | ): |
| 216 | s2.recvmsg(0) # type: ignore[attr-defined] |
| 217 | with pytest.raises( |
| 218 | AttributeError, |
| 219 | match=r"^'FakeSocket' object has no attribute 'recvmsg_into'$", |
| 220 | ): |
| 221 | s2.recvmsg_into([]) # type: ignore[attr-defined] |
| 222 | with pytest.raises(NotImplementedError): |
| 223 | s1.share(0) |
| 224 | |
| 225 | |
| 226 | async def test_basic_tcp() -> None: |
nothing calls this directly
no test coverage detected
searching dependent graphs…