[openstack-dev] [Tempest] Which is the best way for skipping tests?
Joe Hakim Rahme
joe.hakim.rahme at enovance.com
Wed Dec 4 14:24:04 UTC 2013
I am in favor of class level exceptions for the obvious reasons:
+ It reduces code duplication. Copy/pasting a SkipIf decorator on every test
method in the class is tedious and possibly error prone. Adding the exception
as a guard in the setUpClass() makes for a more elegant solution
+ function level skips will waste unnecessary time in the setup/teardown
methods. If I know I'm skipping all the tests in a class, why should I bother
executing all the boilerplate preliminary actions? In the context of heavy
use, like the CI gate, this can accumulate and be a pain.
+ Using function level skips requires importing an extra module (from testtools
import SkipIf) that would be otherwise unnecessary.
If the output of the class level skipException needs to be improved, maybe there
should be a patch there to list all the methods skipped.
If proper fixtures are meant to replace setUpClass in the future (something I
would really love to see in Tempest), we still need to take into account that
setUpClass might do more than just fixtures, and certain guards are expected to
be found in there.
What do you guys think?
Joe H. Rahme
More information about the OpenStack-dev