Your opinion will help to improve our service
Leave a feedback >RegisteredTrx maintains transaction fault injection state to test transaction failure code path.
You may enable specific transaction failure calling enable_trx_failure
on that transaction name. After that, the transaction's Commit
method will throw an exception.
If you don't need a fault injection anymore (e.g. you want to test a successful retry), you may call disable_trx_failure
afterwards.
Example usage:
Public Member Functions | |
__init__ (self) | |
None | enable_failure (self, str name) |
None | disable_failure (self, str name) |
bool | is_failure_enabled (self, str name) |
Protected Attributes | |
_registered_trx | |
None pytest_userver.sql.RegisteredTrx.disable_failure | ( | self, | |
str | name ) |
None pytest_userver.sql.RegisteredTrx.enable_failure | ( | self, | |
str | name ) |
bool pytest_userver.sql.RegisteredTrx.is_failure_enabled | ( | self, | |
str | name ) |