From ca2e4f385802799c2584782a8528e19a9e5513bc Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Fri, 28 Feb 2020 14:56:25 -0500 Subject: 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 --- test/sql/test_compiler.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'test/sql') 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 ", - 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): -- cgit v1.2.1