[Avocado-devel] Implement skip class decorator
jarichte at redhat.com
Mon May 4 10:55:22 UTC 2020
some time ago was added the ability for avocado.skip decorators to be used
on classes. This decorator just loop over all the methods of the class and
marks them as skip
However, this implementation comes a question if this is enough, so I
created this issue.
Because when we want to skip some class, there shouldn't be any code
executed at all, no initialization, nothing. I spent some time on that, and
I didn't find an efficient way how to do that. So I would like to start a
discussion about how it can be done.
The problem is that is difficult to use classic python decorators on that
because they are called with initialization of test class, but at that time
the Loader already loads this test class, and we want to skip that too.
One possible way is to use some tag for skipping, which can be parsed from
the test file. But there is a lot of problems with parsing, like how we
deal with skipIf. Another solution is to use decorators and skip the
initialization of test class and then delete it from the Loader. But I
think that in practice it will have the same effect as looping over all the
methods of the test class.
Now I am stuck in the dead-end with this problem, so any comments or
suggestion will help me a lot.
Red Hat <https://www.redhat.com/>
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Avocado-devel