Skip to content

Instantly share code, notes, and snippets.

@isagalaev
Created November 23, 2018 08:08
Show Gist options
  • Save isagalaev/49a650758ae46b95681dbe01f340363b to your computer and use it in GitHub Desktop.
Save isagalaev/49a650758ae46b95681dbe01f340363b to your computer and use it in GitHub Desktop.
def test_cleanup():
cleaned_objects = []
class A:
def cleanup(self):
cleaned_objects.append(self)
objects = main.init([A, A, A])
main.cleanup(objects)
assert cleaned_objects == objects[::-1]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment