summaryrefslogtreecommitdiff
path: root/test/dialect/mysql
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2023-04-30 18:27:24 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2023-05-09 20:23:48 -0400
commit60b31198311eedfa3814e7098c94d3aa29338fdd (patch)
tree5fe3a55ef67ab14fa63a0a3122a1326b830ceb72 /test/dialect/mysql
parent228490ead7048f2e558c25b0f055bdb952272ec4 (diff)
downloadsqlalchemy-60b31198311eedfa3814e7098c94d3aa29338fdd.tar.gz
fix test suite warnings
fix a handful of warnings that were emitting but not raising, usually because they were inside an "expect_warnings" block. modify "expect_warnings" to always use "raise_on_any_unexpected" behavior; remove this parameter. Fixed issue in semi-private ``await_only()`` and ``await_fallback()`` concurrency functions where the given awaitable would remain un-awaited if the function threw a ``GreenletError``, which could cause "was not awaited" warnings later on if the program continued. In this case, the given awaitable is now cancelled before the exception is thrown. Change-Id: I33668c5e8c670454a3d879e559096fb873b57244
Diffstat (limited to 'test/dialect/mysql')
-rw-r--r--test/dialect/mysql/test_query.py33
1 files changed, 18 insertions, 15 deletions
diff --git a/test/dialect/mysql/test_query.py b/test/dialect/mysql/test_query.py
index 0ce361182..921b5c52b 100644
--- a/test/dialect/mysql/test_query.py
+++ b/test/dialect/mysql/test_query.py
@@ -11,9 +11,9 @@ from sqlalchemy import or_
from sqlalchemy import select
from sqlalchemy import String
from sqlalchemy import Table
-from sqlalchemy import testing
from sqlalchemy import true
from sqlalchemy.testing import eq_
+from sqlalchemy.testing import expect_warnings
from sqlalchemy.testing import fixtures
from sqlalchemy.testing import is_
@@ -22,23 +22,26 @@ class IdiosyncrasyTest(fixtures.TestBase):
__only_on__ = "mysql", "mariadb"
__backend__ = True
- @testing.emits_warning()
def test_is_boolean_symbols_despite_no_native(self, connection):
+ with expect_warnings("Datatype BOOL does not support CAST"):
+ is_(
+ connection.scalar(select(cast(true().is_(true()), Boolean))),
+ True,
+ )
- is_(
- connection.scalar(select(cast(true().is_(true()), Boolean))),
- True,
- )
-
- is_(
- connection.scalar(select(cast(true().is_not(true()), Boolean))),
- False,
- )
+ with expect_warnings("Datatype BOOL does not support CAST"):
+ is_(
+ connection.scalar(
+ select(cast(true().is_not(true()), Boolean))
+ ),
+ False,
+ )
- is_(
- connection.scalar(select(cast(false().is_(false()), Boolean))),
- True,
- )
+ with expect_warnings("Datatype BOOL does not support CAST"):
+ is_(
+ connection.scalar(select(cast(false().is_(false()), Boolean))),
+ True,
+ )
class MatchTest(fixtures.TablesTest):