Unit Testing
On the Unit Testing course for Learn Intermediate Python 3, there is a section that teaches you how to use decorators to skip testing should the test meet (or not meet) certain conditions using @unittest.skipIf/skipUnless(). Whilst this makes sense in principal, I have a question about the output it returns.
Hopefully that screenshot loads - if not, a link to the exercise is here:
https://www.codecademy.com/courses/learn-intermediate-python-3/lessons/int-python-unit-testing/exercises/skipping-tests
My question is: even though we provide an argument within @unittest.skipIf(“Not available on regional jets”), the output when we run the code is “This is a regional jet…”, rather than the argument we gave.
Why is this? I can’t find anywhere in the code block that tells the programme to return that as an output. Is this built in when we import unittest?
Thanks for the help!