diff options
author | Jason Kirtland <jek@discorporate.us> | 2008-01-12 22:03:42 +0000 |
---|---|---|
committer | Jason Kirtland <jek@discorporate.us> | 2008-01-12 22:03:42 +0000 |
commit | 17d3c8764e020379e54053bca0b0a2bc71d48aa0 (patch) | |
tree | 0b46f1ddc57292b8f5bfbc28ab1679230f63e426 /test/perf/ormsession.py | |
parent | c194962019d1bc7322e20b82c33aa1bab3bc2a28 (diff) | |
download | sqlalchemy-17d3c8764e020379e54053bca0b0a2bc71d48aa0.tar.gz |
- testbase is gone, replaced by testenv
- Importing testenv has no side effects- explicit functions provide similar behavior to the old immediate behavior of testbase
- testing.db has the configured db
- Fixed up the perf/* scripts
Diffstat (limited to 'test/perf/ormsession.py')
-rw-r--r-- | test/perf/ormsession.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test/perf/ormsession.py b/test/perf/ormsession.py index 3cd21ea98..b0187a787 100644 --- a/test/perf/ormsession.py +++ b/test/perf/ormsession.py @@ -1,4 +1,4 @@ -import testbase +import testenv; testenv.configure_for_tests() import time from datetime import datetime @@ -78,7 +78,7 @@ def insert_data(): q_sub_per_item = 10 q_customers = 1000 - con = testbase.db.connect() + con = testing.db.connect() transaction = con.begin() data, subdata = [], [] @@ -146,8 +146,8 @@ def insert_data(): def run_queries(): session = create_session() # no explicit transaction here. - - # build a report of summarizing the last 50 purchases and + + # build a report of summarizing the last 50 purchases and # the top 20 items from all purchases q = session.query(Purchase). \ @@ -165,7 +165,7 @@ def run_queries(): for item in purchase.items: report.append(item.name) report.extend([s.name for s in item.subitems]) - + # mix a little low-level with orm # pull a report of the top 20 items of all time _item_id = purchaseitems.c.item_id @@ -212,7 +212,7 @@ def default(): @profiled('all') def main(): - metadata.bind = testbase.db + metadata.bind = testing.db try: define_tables() setup_mappers() |