On Feb 28, 2010, at 8:12 PM, Manlio Perillo wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Michael Bayer ha scritto: >> [...] >> * I have noted that some database objects not directly attached to a >> metadata, like a Sequence, can leave the database in an inconsistent >> state if the associated test suite fails. >> >> I have the same problem with the Schema object. >> If, for some reason, in the test suite there is an error before the >> schema is dropped, the successive run of the test suite will fail, >> since the test will try to create an already existing schema. >> >> Is there a good solution? >> >>> the tests support a --dropfirst option that will remove any errant Table >>> objects. I haven't observed errant sequences to be an issue except perhaps >>> on Oracle, but this system could be enhanced to drop all the sequences too. >> >>> for testing a CREATE SCHEMA construct I would just check the SQL string and >>> not actually execute anything. unit tests should not create any schemas. >>> see the existing schema-listing tests that just use the three which are >>> part of the documented testing environment. >> > > I can't, since I have also to check the `has_schema` method in the Dialect.
call has_schema() on "test_schema", which will exist in a full test environment. then call it on something like "sa_fake_schema_123" to test the "not found" condition. > > > > Manlio > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.10 (GNU/Linux) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iEYEARECAAYFAkuLFGEACgkQscQJ24LbaUSZYwCdEi5Vxhi0o20v3FV6dkWNn/Ui > +MkAn3zWLmmDKs5ErKWCmCtPspoKY7SK > =GwmL > -----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. > -- 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.