-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
type: enhancementnew feature or API change, should be merged into features branchnew feature or API change, should be merged into features branch
Description
https://docs.python.org/3/library/unittest.html#unittest.TestCase.addClassCleanup
Did not see doClassCleanups
mentioned anywhere in this repo, which is the method that should be called. See https://github.com/python/cpython/blob/0f221d09cad46bee38d1b7a7822772df66c53028/Lib/unittest/suite.py#L175
Repo:
import unittest
def cleanup():
assert False
class MyTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.addClassCleanup(cleanup)
def test_one(self):
pass
With unittest:
.E
======================================================================
ERROR: tearDownClass (test_demo.MyTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/petter/source/pytesttest/test_demo.py", line 4, in cleanup
assert False
AssertionError
----------------------------------------------------------------------
Ran 1 test in 0.000s
With Pytest:
collected 1 item
test_demo.py . [100%]
==================================================================================== 1 passed in 0.03s ====================================================================================
Metadata
Metadata
Assignees
Labels
type: enhancementnew feature or API change, should be merged into features branchnew feature or API change, should be merged into features branch