summaryrefslogtreecommitdiff
path: root/test/orm/test_mapper.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2017-09-07 20:38:00 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2017-09-07 20:39:48 -0400
commit60fec8d2f19d8134df06b9cc63c52aae27c9dcfe (patch)
treece212e6eaf0ec575240f6527c04e70e4cf756d78 /test/orm/test_mapper.py
parent2e137b3954f57c0b2e1977419ccecda35b5265b2 (diff)
downloadsqlalchemy-ticket_4071.tar.gz
Remove LRU warningsticket_4071
Removed the warnings that are emitted when the LRU caches employed by the mapper as well as loader srtategies reach their threshold; the purpose of this warning was at first a guard against excess cache keys being generated but became basically a check on the "creating many engines" antipattern. While this is still an antipattern, the presense of test suites which both create an engine per test as well as raise on all warnings will be an inconvenience; it should not be critical that such test suites change their architecture just for this warning (though engine-per-test suite is always better). Change-Id: I41ef8cd642d05a845f53119b196440f9d7879cd9 Fixes: #4071
Diffstat (limited to 'test/orm/test_mapper.py')
-rw-r--r--test/orm/test_mapper.py25
1 files changed, 0 insertions, 25 deletions
diff --git a/test/orm/test_mapper.py b/test/orm/test_mapper.py
index f39e174b0..42d114f6f 100644
--- a/test/orm/test_mapper.py
+++ b/test/orm/test_mapper.py
@@ -262,31 +262,6 @@ class MapperTest(_fixtures.FixtureTest, AssertsCompiledSQL):
assert_raises(TypeError, Foo, x=5)
assert_raises(TypeError, Bar, x=5)
- def test_lru_cache_warning(self):
- users = self.tables.users
- User = self.classes.User
- m = mapper(User, users)
-
- for i in range(149):
- m._compiled_cache["key_%s" % i] = "foo"
-
- def go():
- m._compiled_cache["key_150"] = "foo"
- m._compiled_cache["key_151"] = "foo"
-
- assert_raises_message(
- sa.exc.SAWarning,
- r"Compiled statement cache for mapper Mapper.User.users is "
- "reaching its size threshold of 150, based on "
- "_compiled_cache_size of 100. ",
- go
- )
- m._compiled_cache.size_alert = None
- for i in range(152, 200):
- m._compiled_cache["key_%d" % i] = "foo"
- assert len(m._compiled_cache) < 150
-
-
def test_sort_states_comparisons(self):
"""test that _sort_states() doesn't compare
insert_order to state.key, for set of mixed