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/masscreate.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/masscreate.py')
-rw-r--r-- | test/perf/masscreate.py | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/test/perf/masscreate.py b/test/perf/masscreate.py index 346a725e3..ae32f83e2 100644 --- a/test/perf/masscreate.py +++ b/test/perf/masscreate.py @@ -1,7 +1,7 @@ # times how long it takes to create 26000 objects -import testbase +import testenv; testenv.simple_setup() -from sqlalchemy.orm.attributes import * +from sqlalchemy.orm import attributes import time import gc @@ -13,18 +13,17 @@ class User(object): class Address(object): pass -attr_manager = AttributeManager() if manage_attributes: - attr_manager.register_attribute(User, 'id', uselist=False) - attr_manager.register_attribute(User, 'name', uselist=False) - attr_manager.register_attribute(User, 'addresses', uselist=True, trackparent=True) - attr_manager.register_attribute(Address, 'email', uselist=False) + attributes.register_attribute(User, 'id', False, False) + attributes.register_attribute(User, 'name', False, False) + attributes.register_attribute(User, 'addresses', True, False, trackparent=True) + attributes.register_attribute(Address, 'email', False, False) now = time.time() for i in range(0,130): u = User() if init_attributes: - attr_manager.init_attr(u) + attributes.manage(u) u.id = i u.name = "user " + str(i) if not manage_attributes: @@ -32,7 +31,7 @@ for i in range(0,130): for j in range(0,200): a = Address() if init_attributes: - attr_manager.init_attr(a) + attributes.manage(a) a.email = 'foo@bar.com' u.addresses.append(a) # gc.collect() |