(self)
| 786 | self.assertNotInBytecode(code, "SWAP") |
| 787 | |
| 788 | def test_static_swaps_match_class(self): |
| 789 | forms = [ |
| 790 | "C({}, {}, {})", |
| 791 | "C({}, {}, c={})", |
| 792 | "C({}, b={}, c={})", |
| 793 | "C(a={}, b={}, c={})" |
| 794 | ] |
| 795 | for a, b, c in product("_a", "_b", "_c"): |
| 796 | for form in forms: |
| 797 | pattern = form.format(a, b, c) |
| 798 | with self.subTest(pattern): |
| 799 | code = compile_pattern_with_fast_locals(pattern) |
| 800 | self.assertNotInBytecode(code, "SWAP") |
| 801 | |
| 802 | def test_static_swaps_match_sequence(self): |
| 803 | swaps = {"*_, b, c", "a, *_, c", "a, b, *_"} |
nothing calls this directly
no test coverage detected