Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
skip test_constructor under msan.
  • Loading branch information
gpshead committed Dec 31, 2018
commit f081d1db83bf0e85f774978878f538fea7c0a313
10 changes: 10 additions & 0 deletions Lib/test/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import random
import signal
import sys
import sysconfig
import threading
import time
import unittest
Expand Down Expand Up @@ -59,6 +60,13 @@ def byteslike(*pos, **kw):
class EmptyStruct(ctypes.Structure):
pass

_cflags = sysconfig.get_config_var('CFLAGS') or ''
_config_args = sysconfig.get_config_var('CONFIG_ARGS') or ''
MEMORY_SANITIZER = (
'-fsanitizer=memory' in _cflags or
'--with-memory-sanitizer' in _config_args
)

def _default_chunk_size():
"""Get the default TextIOWrapper chunk size"""
with open(__file__, "r", encoding="latin-1") as f:
Expand Down Expand Up @@ -1496,6 +1504,8 @@ def test_read_on_closed(self):
class CBufferedReaderTest(BufferedReaderTest, SizeofTest):
tp = io.BufferedReader

@unittest.skipIf(MEMORY_SANITIZER, "MSan defaults to crashing "
"instead of returning NULL for malloc failure.")
def test_constructor(self):
BufferedReaderTest.test_constructor(self)
# The allocation can succeed on 32-bit builds, e.g. with more
Expand Down