MCPcopy Index your code
hub / github.com/python/cpython / test_add_nonascii_StringIO_raises

Method test_add_nonascii_StringIO_raises

Lib/test/test_mailbox.py:186–192  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

184 self.assertEqual(self._box.get_string(key), self._template % "0")
185
186 def test_add_nonascii_StringIO_raises(self):
187 with self.assertWarns(DeprecationWarning):
188 with self.assertRaisesRegex(ValueError, "ASCII-only"):
189 self._box.add(io.StringIO(self._nonascii_msg))
190 self.assertEqual(len(self._box), 0)
191 self._box.close()
192 self.assertMailboxEmpty()
193
194 def test_remove(self):
195 # Remove messages using remove()

Callers

nothing calls this directly

Calls 6

assertWarnsMethod · 0.80
assertRaisesRegexMethod · 0.80
addMethod · 0.45
assertEqualMethod · 0.45
closeMethod · 0.45
assertMailboxEmptyMethod · 0.45

Tested by

no test coverage detected