Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle failures at tearDown() #20

Merged
merged 3 commits into from
Mar 19, 2023
Merged

Conversation

kaiosilveira
Copy link
Owner

@kaiosilveira kaiosilveira commented Mar 19, 2023

Bonus: handle failures at tearDown()

Our goal in this PR was to make sure that exceptions in the tearDown() step were caught and reported back to the test client. We accomplish that by wrapping the call to this method with a try/except block.

Closes #19

Checklist:
- handle failures at tearDown() 👈🏼

---

Output:
➜ python3 src/test_case_test.py
6 run, 1 failed
This class will implement the scenario of a test case with a broken tearDown() method, which throws an exception every time it's ran.

Checklist:
- handle failures at tearDown() 👈🏼

---

Output:
➜ python3 src/test_case_test.py
6 run, 1 failed
@kaiosilveira kaiosilveira force-pushed the bonus/handle-failures-at-teardown branch from 13fcc30 to 30c9a78 Compare March 19, 2023 10:07
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
@kaiosilveira kaiosilveira force-pushed the bonus/handle-failures-at-teardown branch from 30c9a78 to e85ae13 Compare March 19, 2023 10:10
@kaiosilveira kaiosilveira marked this pull request as ready for review March 19, 2023 10:11
@kaiosilveira kaiosilveira merged commit e934b97 into main Mar 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handle exceptions at tearDown()
1 participant