Run stubtest on Windows for waitress#9181
Conversation
This comment has been minimized.
This comment has been minimized.
| write: Callable[..., bytes] = ... | ||
| def close(self) -> None: ... | ||
| def fileno(self) -> BytesIO: ... | ||
| if sys.platform == "linux" or sys.platform == "darwin": |
There was a problem hiding this comment.
| if sys.platform == "linux" or sys.platform == "darwin": | |
| if sys.platform != "win32": |
Consistent with the other check you added.
There was a problem hiding this comment.
When the original code does if os.name == "posix" in waitress.trigger, the stub did if sys.platform == "linux" or sys.platform == "darwin" (there's another platform check like this in waitress.trigger).
I added if sys.platform != "win32" in waitress.server to be consistent with other if hasattr(socket, "AF_UNIX") checks.
But I can change them all to be either if you'd like.
There was a problem hiding this comment.
I think the runtime checks are pretty much equivalent, and in stubs we have tended to assume all non-Windows OSes are Unix.
There was a problem hiding this comment.
Sounds good, I'll make all 3 != "win32
…st-waitress-windows
|
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
Yet another stub that benefits from #8923 . Fixing stubtest failure on Windows and offering better coverage.
I did not add
darwintoplatformsbecause it would be redundant withlinux. But I still added astubtest_allowlist_darwin.txtfor those who would like to run it locally on macos. (This is the edge case mentioned in #9173 )