-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Michael Bayer ha scritto: > [...] >> >> 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 is a boolean value, and it is set from a nose config option, defined in the SQLAlchemy plugin. > 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....) > The problem is that if I don't use my plugin (with a score higher than the one of the SQLAlchemy plugin), the wantMethod from SQLAlchemy plugin will be used, thus ignoring all "normal" tests cases (that is, test cases not derived from sqlalchemy.testing.TestBase). Regards Manlio -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkv2lWEACgkQscQJ24LbaUTzxwCeOcCmfNOAhGgLNjlaM6YLvDxc sp0AmQFC0OXr/KLeHlJpg7hwZ9MieOEk =/PGv -----END PGP SIGNATURE----- -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.