diff --git a/tests/hazmat/primitives/test_aead.py b/tests/hazmat/primitives/test_aead.py index d129a98ebc58..635a8029eaf1 100644 --- a/tests/hazmat/primitives/test_aead.py +++ b/tests/hazmat/primitives/test_aead.py @@ -39,7 +39,11 @@ def _aead_supported(cls): def large_mmap(length: int = 2**32): # Silencing mypy warning on Windows, even though mmap doesn't exist there. - return mmap.mmap(-1, length, prot=mmap.PROT_READ) # type: ignore + # See: https://mypy.readthedocs.io/en/stable/common_issues.html#version-and-platform-checks + if sys.platform != "win32": + return mmap.mmap(-1, length, prot=mmap.PROT_READ) + else: + return mmap.mmap(-1, length) # pragma: no cover @pytest.mark.skipif(