How to Make Setup and Teardown Fail
BivouacingFirm路3 months agoIf you're testing or scripting, just add a line in your setup or teardown function that intentionally causes an error, like `assert false` or `raise Exception('Intentional Failure')`.
Win gift cards by playing fun games on Playbite!
Playbite
500k winners and counting...
More Answers
To make a setup fail, just throw an exception during the setup phase. For teardown, do something similar by throwing an exception in the teardown phase. Simple as pie!
From my experience, a surefire way to make setup fail is to include a non-existent file or resource in your setup code. For teardown, you could try to delete something that's already been deleted!
馃憖 If you like Teardown...
Diego路3 hours agoThe brands referenced on this page are not sponsors of the rewards or otherwise affiliated with this company. The logos and other identifying marks attached are trademarks of and owned by each represented company and/or its affiliates. Please visit each company's website for additional terms and conditions.
People also want to know
Add an Answer