diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2022-01-20 12:26:36 -0500 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2022-01-20 13:25:11 -0500 |
| commit | 867235e4902c91531095676e3a413d935181b0bd (patch) | |
| tree | 921c46b34c1c95f9f2e6ca1b5c75bc8f06e2888b /test/sql/test_compiler.py | |
| parent | c6b15e443e0cfc7a09eb24c37123a595fdb639ca (diff) | |
| download | sqlalchemy-867235e4902c91531095676e3a413d935181b0bd.tar.gz | |
repair broken truediv test suite; memusage
the truediv test suite didn't have __backend__ so wasn't running
for every DB except in the main build. Repaired this as well
as truediv support to preserve the right-hand side type
when casting to numeric, if the right type is already a
numeric type.
also fixed a memusage test that relies on savepoints so was
not running under gerrit runs.
Change-Id: I3be223fdf697af9c1ed61b70d621f57cbbb7a92b
Diffstat (limited to 'test/sql/test_compiler.py')
| -rw-r--r-- | test/sql/test_compiler.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/sql/test_compiler.py b/test/sql/test_compiler.py index c273dbbf8..d20037e92 100644 --- a/test/sql/test_compiler.py +++ b/test/sql/test_compiler.py @@ -2244,7 +2244,7 @@ class SelectTest(fixtures.TestBase, AssertsCompiledSQL): (value_tbl.c.val2 - value_tbl.c.val1) / value_tbl.c.val1, ), "SELECT values.id, (values.val2 - values.val1) " - "/ CAST(values.val1 AS NUMERIC) AS anon_1 FROM values", + "/ CAST(values.val1 AS FLOAT) AS anon_1 FROM values", ) self.assert_compile( @@ -2253,7 +2253,7 @@ class SelectTest(fixtures.TestBase, AssertsCompiledSQL): ), "SELECT values.id FROM values WHERE " "(values.val2 - values.val1) / " - "CAST(values.val1 AS NUMERIC) > :param_1", + "CAST(values.val1 AS FLOAT) > :param_1", ) self.assert_compile( @@ -2264,8 +2264,8 @@ class SelectTest(fixtures.TestBase, AssertsCompiledSQL): > 2.0, ), "SELECT values.id FROM values WHERE " - "(values.val1 / CAST((values.val2 - values.val1) AS NUMERIC)) " - "/ CAST(values.val1 AS NUMERIC) > :param_1", + "(values.val1 / CAST((values.val2 - values.val1) AS FLOAT)) " + "/ CAST(values.val1 AS FLOAT) > :param_1", ) def test_percent_chars(self): |
