summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-08-19 14:12:46 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2014-08-19 14:12:46 (GMT)
commitef1a79799ff9e1c0b94eb7ee753cb8e263605c34 (patch)
treeff0790d4f0bf474388e189908092ef76a1f8ba96 /Lib/test
parent79c27c331927e0354f335362010ff86ba1855280 (diff)
parent76b47655ffcb012dda7886dbdbf80c36254c5d2c (diff)
downloadcpython-ef1a79799ff9e1c0b94eb7ee753cb8e263605c34.zip
cpython-ef1a79799ff9e1c0b94eb7ee753cb8e263605c34.tar.gz
cpython-ef1a79799ff9e1c0b94eb7ee753cb8e263605c34.tar.bz2
Issue #15696: Add a __sizeof__ implementation for mmap objects on Windows.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_mmap.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/Lib/test/test_mmap.py b/Lib/test/test_mmap.py
index 6ca5e1b..fa693f3 100644
--- a/Lib/test/test_mmap.py
+++ b/Lib/test/test_mmap.py
@@ -1,5 +1,5 @@
from test.support import (TESTFN, run_unittest, import_module, unlink,
- requires, _2G, _4G, gc_collect)
+ requires, _2G, _4G, gc_collect, cpython_only)
import unittest
import os
import re
@@ -639,6 +639,15 @@ class MmapTests(unittest.TestCase):
m2.close()
m1.close()
+ @cpython_only
+ @unittest.skipUnless(os.name == 'nt', 'requires Windows')
+ def test_sizeof(self):
+ m1 = mmap.mmap(-1, 100)
+ tagname = "foo"
+ m2 = mmap.mmap(-1, 100, tagname=tagname)
+ self.assertEqual(sys.getsize(m2),
+ sys.getsize(m1) + len(tagname) + 1)
+
@unittest.skipUnless(os.name == 'nt', 'requires Windows')
def test_crasher_on_windows(self):
# Should not crash (Issue 1733986)