On May 21, 2010, at 9:15 AM, Manlio Perillo wrote: > Hi. > > In a project using SQLAlchemy I decided to use the SQL nose plugin, in > order to avoid reinventing the wheel. > > Unfortunately it seems the plugin is a bit too invasive and it will only > work with SQLAlchemy test suite. > > The problem is with the wantClass method, that pratically will ignore > all normal test cases. > > Fortunately, in my case I use an additional nose plugin: > http://bitbucket.org/mperillo/nose-tree > > and increasing its score solved the problem.
> > > Is is possible to modify the SQLAlchemy nose plugin in order to be more > cooperative? > As an example by adding an option that will change the wantClass method from > > if not issubclass(cls, testing.TestBase): > return False > else: > if (hasattr(cls, '__whitelist__') and testing.db.name in > cls.__whitelist__): > return True > else: > return not self.__should_skip_for(cls) > > to something like (not tested): > > if self.sa_only and not issubclass(cls, testing.TestBase): > return False > > if issubclass(cls, testing.TestBase): > if (hasattr(cls, '__whitelist__') and testing.db.name in > cls.__whitelist__): > return True > else: > return not self.__should_skip_for(cls) > > # use nose default whats "sa_only" and how does that get set ? it seems like the "score" attribute is already provided by Nose for the purpose of setting plugin priority ? (since you are already setting attributes on plugins, it seems....) -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
