<div dir="ltr"><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">Yes you are right it is possible to do that, but I think that we can't just avoid loading the class, because we have to mark all the test inside the class as skipped, and also I don't see the way how to deal with constraints in skipIf() and skipUnless() methods when we avoid loading class.</blockquote></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, May 4, 2020 at 3:01 PM Amador Pahim <<a href="mailto:amador@pahim.org" target="_blank">amador@pahim.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, May 4, 2020 at 11:55 AM Jan Richter <<a href="mailto:jarichte@redhat.com" target="_blank">jarichte@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hello everyone,<br>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<div><a href="https://github.com/avocado-framework/avocado/pull/3570" target="_blank">https://github.com/avocado-framework/avocado/pull/3570</a><br>However, this implementation comes a question if this is enough, so I created this issue. </div><div><a href="https://github.com/avocado-framework/avocado/issues/3579" target="_blank">https://github.com/avocado-framework/avocado/issues/3579</a><br>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.</div><div><br>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. <br></div></div></blockquote><div><br></div><div>Can we avoid loading the class that has the decorator? We are using inspect already... </div><div><a href="https://github.com/avocado-framework/avocado/blob/master/avocado/core/loader.py#L289-L294" target="_blank">https://github.com/avocado-framework/avocado/blob/master/avocado/core/loader.py#L289-L294</a><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><br>Now I am stuck in the dead-end with this problem, so any comments or suggestion will help me a lot. <br><br>Best regards,<br clear="all"><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><p style="color:rgb(0,0,0);font-family:RedHatText,sans-serif;font-weight:bold;margin:0px;padding:0px;font-size:14px"><span>Jan</span> <span>Richter</span><span style="text-transform:uppercase;color:rgb(170,170,170);margin:0px"></span></p><p style="color:rgb(0,0,0);font-family:RedHatText,sans-serif;font-size:12px;margin:0px"><span>Intern</span></p><p style="color:rgb(0,0,0);font-family:RedHatText,sans-serif;margin:0px 0px 4px;font-size:12px"><a href="https://www.redhat.com/" style="color:rgb(0,136,206);margin:0px" target="_blank">Red Hat<span></span></a></p><div style="color:rgb(0,0,0);font-family:RedHatText,sans-serif;font-size:medium;margin-bottom:4px"></div><p style="color:rgb(0,0,0);font-family:RedHatText,sans-serif;margin:0px;font-size:12px"></p><div style="color:rgb(0,0,0);font-family:RedHatText,sans-serif;font-size:medium;margin-top:12px"><table border="0"><tbody><tr><td width="100px"><a href="https://www.redhat.com/" target="_blank"><img src="https://static.redhat.com/libs/redhat/brand-assets/2/corp/logo--200.png" width="90" height="auto"></a></td></tr></tbody></table></div></div></div></div></div>
</blockquote></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><p style="color:rgb(0,0,0);font-family:RedHatText,sans-serif;font-weight:bold;margin:0px;padding:0px;font-size:14px"><span>Jan</span> <span>Richter</span><span style="text-transform:uppercase;color:rgb(170,170,170);margin:0px"></span></p><p style="color:rgb(0,0,0);font-family:RedHatText,sans-serif;font-size:12px;margin:0px"><span>Intern</span></p><p style="color:rgb(0,0,0);font-family:RedHatText,sans-serif;margin:0px 0px 4px;font-size:12px"><a href="https://www.redhat.com/" style="color:rgb(0,136,206);margin:0px" target="_blank">Red Hat<span></span></a></p><div style="color:rgb(0,0,0);font-family:RedHatText,sans-serif;font-size:medium;margin-bottom:4px"></div><p style="color:rgb(0,0,0);font-family:RedHatText,sans-serif;margin:0px;font-size:12px"></p><div style="color:rgb(0,0,0);font-family:RedHatText,sans-serif;font-size:medium;margin-top:12px"><table border="0"><tbody><tr><td width="100px"><a href="https://www.redhat.com/" target="_blank"><img src="https://static.redhat.com/libs/redhat/brand-assets/2/corp/logo--200.png" width="90" height="auto"></a></td></tr></tbody></table></div></div></div>