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

Method test_exceptions_propagate

Lib/test/test_py_compile.py:148–158  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

146 'cannot control directory permissions on Windows')
147 @os_helper.skip_unless_working_chmod
148 def test_exceptions_propagate(self):
149 # Make sure that exceptions raised thanks to issues with writing
150 # bytecode.
151 # http://bugs.python.org/issue17244
152 mode = os.stat(self.directory)
153 os.chmod(self.directory, stat.S_IREAD)
154 try:
155 with self.assertRaises(IOError):
156 py_compile.compile(self.source_path, self.pyc_path)
157 finally:
158 os.chmod(self.directory, mode.st_mode)
159
160 def test_bad_coding(self):
161 bad_coding = os.path.join(os.path.dirname(__file__),

Callers

nothing calls this directly

Calls 4

statMethod · 0.45
chmodMethod · 0.45
assertRaisesMethod · 0.45
compileMethod · 0.45

Tested by

no test coverage detected