Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions python-stdlib/unittest/unittest.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,13 @@ def wasSuccessful(self):
# TODO: Uncompliant
def run_class(c, test_result):
o = c()
set_up_class = getattr(o, "setUpClass", lambda: None)
tear_down_class = getattr(o, "tearDownClass", lambda: None)
set_up = getattr(o, "setUp", lambda: None)
tear_down = getattr(o, "tearDown", lambda: None)

set_up_class()

for name in dir(o):
if name.startswith("test"):
print("%s (%s) ..." % (name, c.__qualname__), end="")
Expand All @@ -210,6 +215,8 @@ def run_class(c, test_result):
continue
finally:
tear_down()

tear_down_class()


def main(module="__main__"):
Expand Down