From: Mike Bayer Date: Wed, 12 Apr 2017 19:28:05 +0000 (-0400) Subject: - try one more test, then we're likely going to give up on cx_Oracle X-Git-Tag: rel_1_2_0b1~102 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bfaef1eaf54e0901b964ee163e179f6ec6cbd6e5;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - try one more test, then we're likely going to give up on cx_Oracle Change-Id: I7f9a1265664b0368ee7a771d01c7ca1612156d1f --- diff --git a/test/aaa_profiling/test_memusage.py b/test/aaa_profiling/test_memusage.py index da9103bcf0..e038d5c387 100644 --- a/test/aaa_profiling/test_memusage.py +++ b/test/aaa_profiling/test_memusage.py @@ -147,6 +147,36 @@ class MemUsageTest(EnsureZeroed): to_unicode_processor_factory('utf8') go() + def test_ad_hoc_types(self): + """test storage of bind processors, result processors + in dialect-wide registry.""" + + from sqlalchemy.dialects import mysql, postgresql, sqlite + from sqlalchemy import types + + eng = engines.testing_engine() + for args in ( + (types.Integer, ), + (types.String, ), + (types.PickleType, ), + (types.Enum, 'a', 'b', 'c'), + (sqlite.DATETIME, ), + (postgresql.ENUM, 'a', 'b', 'c'), + (types.Interval, ), + (postgresql.INTERVAL, ), + (mysql.VARCHAR, ), + ): + @profile_memory() + def go(): + type_ = args[0](*args[1:]) + bp = type_._cached_bind_processor(eng.dialect) + rp = type_._cached_result_processor(eng.dialect, 0) + bp, rp # strong reference + go() + + assert not eng.dialect._type_memos + + class MemUsageWBackendTest(EnsureZeroed): __tags__ = 'memory_intensive', @@ -302,35 +332,6 @@ class MemUsageWBackendTest(EnsureZeroed): del m1, m2, m3 assert_no_mappers() - def test_ad_hoc_types(self): - """test storage of bind processors, result processors - in dialect-wide registry.""" - - from sqlalchemy.dialects import mysql, postgresql, sqlite - from sqlalchemy import types - - eng = engines.testing_engine() - for args in ( - (types.Integer, ), - (types.String, ), - (types.PickleType, ), - (types.Enum, 'a', 'b', 'c'), - (sqlite.DATETIME, ), - (postgresql.ENUM, 'a', 'b', 'c'), - (types.Interval, ), - (postgresql.INTERVAL, ), - (mysql.VARCHAR, ), - ): - @profile_memory() - def go(): - type_ = args[0](*args[1:]) - bp = type_._cached_bind_processor(eng.dialect) - rp = type_._cached_result_processor(eng.dialect, 0) - bp, rp # strong reference - go() - - assert not eng.dialect._type_memos - @testing.emits_warning("Compiled statement cache for.*") def test_many_updates(self): metadata = MetaData(self.engine)