openerp-expert-framework team mailing list archive
-
openerp-expert-framework team
-
Mailing list archive
-
Message #00621
Re: Asserting exceptions in YAML tests
----- Message d'origine -----
> On Friday 23 September 2011, Georges Racinet wrote:
>
> > - Other ideas ?
>
>
> savepoints!
Yeah, that'd be neat to have a savepoint at the beginning of the processing of a !raises block. But the question remains how to cleanly introduce this. Again, nothing that can't be done with monkey patching (hence with little impact on other parts of the framework)
But usage of txn savepoints in tests or in the framework in general might be way beyond the scope of this discussion and should be designed independently ? I'm too new around here to know, so tell me :-)
For the record, I'd certainly love options such as rollback and commit of tests to a savepoint right before some failing for introspection, quick replay of the failing test to ease test driven development or debugging...
Regards,
>
> test_bqi=> BEGIN;
> test_bqi=> SAVEPOINT "foo";
> SAVEPOINT
> test_bqi=> SELECT * from error;
> ERROR: relation "error" does not exist
> LINE 1: SELECT * from error;
> ^
> test_bqi=> SELECT * from error2;
> ERROR: current transaction is aborted, commands ignored until end of
> transaction block
> test_bqi=> ROLLBACK TO SAVEPOINT "foo";
> ROLLBACK
> test_bqi=> SELECT * from res_users;
> id | name | active | login ....
> .....
>
> They create a "nested" transaction in the sense that we can rollback to
> the point before the validation error.
>
>
> --
> Say NO to spam and viruses. Stop using Microsoft Windows!
>
> _______________________________________________
> Mailing list: https://launchpad.net/~openerp-expert-framework
> Post to : openerp-expert-framework@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~openerp-expert-framework
> More help : https://help.launchpad.net/ListHelp
References