Skip to content

Commit ba674d5

Browse files
committed
Check the error on FreeBSD
1 parent 5151a11 commit ba674d5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Lib/test/test_mmap.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1173,8 +1173,12 @@ def test_flush_parameters(self):
11731173
if hasattr(mmap, 'MS_INVALIDATE'):
11741174
m.flush(PAGESIZE * 2, flags=mmap.MS_INVALIDATE)
11751175
if hasattr(mmap, 'MS_ASYNC') and hasattr(mmap, 'MS_INVALIDATE'):
1176-
if sys.platform != 'freebsd':
1176+
if sys.platform == 'freebsd':
11771177
# FreeBSD doesn't support this combination
1178+
with self.assertRaises(OSError) as cm:
1179+
m.flush(0, PAGESIZE, flags=mmap.MS_ASYNC | mmap.MS_INVALIDATE)
1180+
self.assertEqual(cm.exception.errno, errno.EINVAL)
1181+
else:
11781182
m.flush(0, PAGESIZE, flags=mmap.MS_ASYNC | mmap.MS_INVALIDATE)
11791183

11801184
@unittest.skipUnless(sys.platform == 'linux', 'Linux only')

0 commit comments

Comments
 (0)