A version of assertRaisesRegex with automatic transaction recovery
(self, exception, regex, msg=None, **kwargs)
| 914 | |
| 915 | @contextlib.asynccontextmanager |
| 916 | async def assertRaisesRegexTx(self, exception, regex, msg=None, **kwargs): |
| 917 | """A version of assertRaisesRegex with automatic transaction recovery |
| 918 | """ |
| 919 | |
| 920 | with super().assertRaisesRegex(exception, regex, msg=msg, **kwargs): |
| 921 | try: |
| 922 | tx = self.con.transaction() |
| 923 | await tx.start() |
| 924 | yield |
| 925 | finally: |
| 926 | await tx.rollback() |
| 927 | |
| 928 | @classmethod |
| 929 | @contextlib.contextmanager |