(self)
| 329 | self.assert_("Error in str() of DB-API" in e.args[0]) |
| 330 | |
| 331 | def test_db_error_noncompliant_dbapi(self): |
| 332 | try: |
| 333 | raise sa_exceptions.DBAPIError.instance( |
| 334 | "", [], OutOfSpec(), DatabaseError |
| 335 | ) |
| 336 | except sa_exceptions.DBAPIError as e: |
| 337 | # OutOfSpec subclasses DatabaseError |
| 338 | self.assert_(e.__class__ is sa_exceptions.DatabaseError) |
| 339 | except OutOfSpec: |
| 340 | self.assert_(False) |
| 341 | |
| 342 | try: |
| 343 | raise sa_exceptions.DBAPIError.instance( |
| 344 | "", [], sa_exceptions.ArgumentError(), DatabaseError |
| 345 | ) |
| 346 | except sa_exceptions.DBAPIError as e: |
| 347 | self.assert_(e.__class__ is sa_exceptions.DBAPIError) |
| 348 | except sa_exceptions.ArgumentError: |
| 349 | self.assert_(False) |
| 350 | |
| 351 | dialect = self._translating_dialect_fixture() |
| 352 | try: |
| 353 | raise sa_exceptions.DBAPIError.instance( |
| 354 | "", |
| 355 | [], |
| 356 | sa_exceptions.ArgumentError(), |
| 357 | DatabaseError, |
| 358 | dialect=dialect, |
| 359 | ) |
| 360 | except sa_exceptions.DBAPIError as e: |
| 361 | self.assert_(e.__class__ is sa_exceptions.DBAPIError) |
| 362 | except sa_exceptions.ArgumentError: |
| 363 | self.assert_(False) |
| 364 | |
| 365 | def test_db_error_dbapi_uses_wrong_names(self): |
| 366 | dialect = self._translating_dialect_fixture() |
nothing calls this directly
no test coverage detected