(self)
| 1069 | self.check_hardlinks(script, docstring, assertion) |
| 1070 | |
| 1071 | def test_only_two_levels(self): |
| 1072 | # Don't build the 3 optimization levels, but only 2 |
| 1073 | for opts in ((0, 1), (1, 2), (0, 2)): |
| 1074 | with self.subTest(opts=opts): |
| 1075 | with self.temporary_directory(): |
| 1076 | # code with no dostring and no assertion: |
| 1077 | # same bytecode for all optimization levels |
| 1078 | script = self.make_script(self.create_code()) |
| 1079 | self.compile_dir(optimize=opts) |
| 1080 | pyc1 = get_pyc(script, opts[0]) |
| 1081 | pyc2 = get_pyc(script, opts[1]) |
| 1082 | self.assertTrue(is_hardlink(pyc1, pyc2)) |
| 1083 | |
| 1084 | def test_duplicated_levels(self): |
| 1085 | # compile_dir() must not fail if optimize contains duplicated |
nothing calls this directly
no test coverage detected