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

Method test_open

Lib/test/test_codecs.py:1863–1868  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1861 getattr(codecs, api)
1862
1863 def test_open(self):
1864 self.addCleanup(os_helper.unlink, os_helper.TESTFN)
1865 for mode in ('w', 'r', 'r+', 'w+', 'a', 'a+'):
1866 with self.subTest(mode), self.assertWarns(DeprecationWarning):
1867 with codecs.open(os_helper.TESTFN, mode, 'ascii') as file:
1868 self.assertIsInstance(file, codecs.StreamReaderWriter)
1869
1870 def test_undefined(self):
1871 self.assertRaises(UnicodeError, codecs.encode, 'abc', 'undefined')

Callers

nothing calls this directly

Calls 5

addCleanupMethod · 0.80
assertWarnsMethod · 0.80
assertIsInstanceMethod · 0.80
subTestMethod · 0.45
openMethod · 0.45

Tested by

no test coverage detected