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

Method test_source_date_epoch

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

Source from the content-addressed store, hash-verified

167 self.assertFalse(os.path.exists(self.pyc_path))
168
169 def test_source_date_epoch(self):
170 py_compile.compile(self.source_path, self.pyc_path)
171 self.assertTrue(os.path.exists(self.pyc_path))
172 self.assert_cache_path_exists(False)
173 with open(self.pyc_path, 'rb') as fp:
174 flags = importlib._bootstrap_external._classify_pyc(
175 fp.read(), 'test', {})
176 if os.environ.get('SOURCE_DATE_EPOCH'):
177 expected_flags = 0b11
178 else:
179 expected_flags = 0b00
180
181 self.assertEqual(flags, expected_flags)
182
183 @unittest.skipIf(sys.flags.optimize > 0, 'test does not work with -O')
184 @unittest.skipIf(sys.implementation.cache_tag is None,

Callers

nothing calls this directly

Calls 8

assertTrueMethod · 0.80
openFunction · 0.50
compileMethod · 0.45
existsMethod · 0.45
readMethod · 0.45
getMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected