Skip to content

Commit

Permalink
handle tearDown() faiures at TestCase.run()
Browse files Browse the repository at this point in the history
Exceptions at tearDown() are now captured and handled properly.

Checklist:
- handle failures at tearDown() πŸ‘ˆπŸΌ

---

Output:
➜ python3 src/test_case_test.py
6 run, 0 failed
  • Loading branch information
kaiosilveira committed Mar 19, 2023
1 parent 447bfd7 commit 30c9a78
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/test_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ def run(self, result) -> None:
except:
result.testFailed()

self.tearDown()
try:
self.tearDown()
except:
result.testFailed()

def tearDown(self) -> None:
pass

0 comments on commit 30c9a78

Please sign in to comment.