GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [GR-57290] Add regression test for clearing globals. · elide-dev/graalpython@8f70104

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • graalpython/com.oracle.graal.python.test/src/tests
    • test_frame_tests.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎graalpython/com.oracle.graal.python.test/src/tests/test_frame_tests.py‎

Copy file name to clipboardExpand all lines: graalpython/com.oracle.graal.python.test/src/tests/test_frame_tests.py
+11-1Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
1+
# Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved.
22
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
33
#
44
# The Universal Permissive License (UPL), Version 1.0
@@ -221,3 +221,13 @@ class Foo:
221221
# assert e.__traceback__.tb_frame.f_back.f_code == sys._getframe(0).f_back.f_code
222222
# assert e.__traceback__.tb_next.tb_next.tb_frame.f_back.f_code == foo.__code__
223223
# assert e.__traceback__.tb_next.tb_frame.f_back.f_code == test_backref_from_traceback.__code__
224+
225+
226+
def test_clearing_globals():
227+
global foo, junk
228+
foo = 123
229+
assert "foo" in globals().keys()
230+
assert "junk" not in globals().keys()
231+
junk = globals().clear()
232+
assert "foo" not in globals().keys()
233+
assert "junk" in globals().keys()

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.