diff options
author | Tian Gao <gaogaotiantian@hotmail.com> | 2024-05-04 11:12:10 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-04 11:12:10 (GMT) |
commit | b034f14a4b6e9197d3926046721b8b4b4b4f5b3d (patch) | |
tree | 2d641189f3401526d264d13e5b855c576c29dc63 /Lib/test/test_peepholer.py | |
parent | 1ab6356ebec25f216a0eddbd81225abcb93f2d55 (diff) | |
download | cpython-b034f14a4b6e9197d3926046721b8b4b4b4f5b3d.zip cpython-b034f14a4b6e9197d3926046721b8b4b4b4f5b3d.tar.gz cpython-b034f14a4b6e9197d3926046721b8b4b4b4f5b3d.tar.bz2 |
gh-74929: Implement PEP 667 (GH-115153)
Diffstat (limited to 'Lib/test/test_peepholer.py')
-rw-r--r-- | Lib/test/test_peepholer.py | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/Lib/test/test_peepholer.py b/Lib/test/test_peepholer.py index 6989aaf..6c27ee4 100644 --- a/Lib/test/test_peepholer.py +++ b/Lib/test/test_peepholer.py @@ -933,23 +933,6 @@ class TestMarkingVariablesAsUnKnown(BytecodeTestCase): self.assertNotInBytecode(f, "LOAD_FAST_CHECK") return f - def test_deleting_local_warns_and_assigns_none(self): - f = self.make_function_with_no_checks() - co_code = f.__code__.co_code - def trace(frame, event, arg): - if event == 'line' and frame.f_lineno == 4: - del frame.f_locals["x"] - sys.settrace(None) - return None - return trace - e = r"assigning None to unbound local 'x'" - with self.assertWarnsRegex(RuntimeWarning, e): - sys.settrace(trace) - f() - self.assertInBytecode(f, "LOAD_FAST") - self.assertNotInBytecode(f, "LOAD_FAST_CHECK") - self.assertEqual(f.__code__.co_code, co_code) - def test_modifying_local_does_not_add_check(self): f = self.make_function_with_no_checks() def trace(frame, event, arg): |