MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_crasher_on_windows

Method test_crasher_on_windows

Lib/test/test_mmap.py:659–683  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

657
658 @unittest.skipUnless(os.name == 'nt', 'requires Windows')
659 def test_crasher_on_windows(self):
660 # Should not crash (Issue 1733986)
661 tagname = random_tagname()
662 m = mmap.mmap(-1, 1000, tagname=tagname)
663 try:
664 mmap.mmap(-1, 5000, tagname=tagname)[:] # same tagname, but larger size
665 except:
666 pass
667 m.close()
668
669 # Should not crash (Issue 5385)
670 with open(TESTFN, "wb") as fp:
671 fp.write(b"x"*10)
672 f = open(TESTFN, "r+b")
673 m = mmap.mmap(f.fileno(), 0)
674 f.close()
675 try:
676 m.resize(0) # will raise OSError
677 except:
678 pass
679 try:
680 m[:]
681 except:
682 pass
683 m.close()
684
685 @unittest.skipUnless(os.name == 'nt', 'requires Windows')
686 def test_invalid_descriptor(self):

Callers

nothing calls this directly

Calls 6

random_tagnameFunction · 0.85
openFunction · 0.50
closeMethod · 0.45
writeMethod · 0.45
filenoMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected