Skip to content

Instantly share code, notes, and snippets.

@beam2d
Created October 11, 2018 15:20
Show Gist options
  • Save beam2d/e58e5c5e6e835541acfac407d249489a to your computer and use it in GitHub Desktop.
Save beam2d/e58e5c5e6e835541acfac407d249489a to your computer and use it in GitHub Desktop.
$ nosetests -s test_foo.py
foo 140123586741304
.foo2 140123497640736
.
----------------------------------------------------------------------
Ran 2 tests in 0.000s
OK
del 140123586741304
del 140123497640736
$ pytest -s testS_foo.py
============================= test session starts ==============================
platform linux -- Python 3.6.4, pytest-3.5.0, py-1.5.3, pluggy-0.6.0
rootdir: ***, inifile:
collected 2 items
test_foo.py foo 139935499752336
.del 139935499752336
foo2 139935499752336
.del 139935499752336
=========================== 2 passed in 0.01 seconds ===========================
import unittest
class FooTest(unittest.TestCase):
def __del__(self):
print('del', id(self))
def test_foo(self):
print('foo', id(self))
def test_foo2(self):
print('foo2', id(self))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment