summaryrefslogtreecommitdiff
path: root/test/sql
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2020-02-28 14:56:25 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2020-03-01 19:32:48 -0500
commitca2e4f385802799c2584782a8528e19a9e5513bc (patch)
tree0846dd8618b2bc7263cd8c0a309801a94d06f92a /test/sql
parent132006ba8a714199d4f761b0e66fc2e516e46ba3 (diff)
downloadsqlalchemy-ca2e4f385802799c2584782a8528e19a9e5513bc.tar.gz
Discontinue dynamic __visit_name__
Removed very antiquated logic that checks if __visit_name__ is a property. There's no need for this as the compiler can handle switching between implementations. Convert _compile_dispatch() to be fully inlined. Change-Id: Ic0c7247c2d7dfed93a27f09250a8ed6352370764
Diffstat (limited to 'test/sql')
-rw-r--r--test/sql/test_compiler.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/test/sql/test_compiler.py b/test/sql/test_compiler.py
index 6f16f0514..5030f9df8 100644
--- a/test/sql/test_compiler.py
+++ b/test/sql/test_compiler.py
@@ -3642,16 +3642,17 @@ class UnsupportedTest(fixtures.TestBase):
def test_unsupported_element_meth_visit_name(self):
from sqlalchemy.sql.expression import ClauseElement
- class SomeElement(ClauseElement):
- @classmethod
- def __visit_name__(cls):
- return "some_element"
+ def go():
+ class SomeElement(ClauseElement):
+ @classmethod
+ def __visit_name__(cls):
+ return "some_element"
assert_raises_message(
- exc.UnsupportedCompilationError,
- r"Compiler <sqlalchemy.sql.compiler.StrSQLCompiler .*"
- r"can't render element of type <class '.*SomeElement'>",
- SomeElement().compile,
+ exc.InvalidRequestError,
+ r"__visit_name__ on class SomeElement must be a string at "
+ r"the class level",
+ go,
)
def test_unsupported_operator(self):