Skip to content

Commit

Permalink
Add test suggested by Alex
Browse files Browse the repository at this point in the history
  • Loading branch information
JelleZijlstra committed Nov 29, 2023
1 parent d528dc8 commit e323502
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Lib/test/test_warnings/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1649,6 +1649,13 @@ class Foo: ...
@deprecated
def foo(): ...

def test_no_retained_references_to_wrapper_instance(self):
@deprecated('depr')
def d(): pass

self.assertFalse(any(
isinstance(cell.cell_contents, deprecated) for cell in d.__closure__
))

def setUpModule():
py_warnings.onceregistry.clear()
Expand Down

0 comments on commit e323502

Please sign in to comment.