| 396 | self._do_test(same_name_as_bad_test) |
| 397 | |
| 398 | def test_bytecode(self): |
| 399 | base_path = os.path.join(self.test_dir, 'a') |
| 400 | source_path = base_path + importlib.machinery.SOURCE_SUFFIXES[0] |
| 401 | bytecode_path = base_path + importlib.machinery.BYTECODE_SUFFIXES[0] |
| 402 | with open_file(source_path) as file: |
| 403 | file.write('testing_modulefinder = True\n'.encode('utf-8')) |
| 404 | py_compile.compile(source_path, cfile=bytecode_path) |
| 405 | os.remove(source_path) |
| 406 | self._do_test(bytecode_test) |
| 407 | |
| 408 | def test_replace_paths(self): |
| 409 | old_path = os.path.join(self.test_dir, 'a', 'module.py') |