~ubuntu-branches/debian/jessie/sqlalchemy/jessie

« back to all changes in this revision

Viewing changes to test/aaa_profiling/test_zoomark.py

  • Committer: Bazaar Package Importer
  • Author(s): Piotr Ożarowski
  • Date: 2011-08-01 23:18:16 UTC
  • mfrom: (1.4.15 upstream) (16.1.14 experimental)
  • Revision ID: james.westby@ubuntu.com-20110801231816-6lx797pi3q1fpqst
Tags: 0.7.2-1
* New upstream release
* Bump minimum required python-mako version to 0.4.1 (closes: 635898)

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
import sys
8
8
import time
9
9
from sqlalchemy import *
10
 
from sqlalchemy.test import *
 
10
from test.lib import *
11
11
ITERATIONS = 1
12
12
dbapi_session = engines.ReplayableSession()
13
13
metadata = None
14
14
 
15
15
 
16
 
class ZooMarkTest(TestBase):
 
16
class ZooMarkTest(fixtures.TestBase):
17
17
 
18
18
    """Runs the ZooMark and squawks if method counts vary from the norm.
19
19
 
25
25
    components individually will fail.
26
26
 
27
27
    """
28
 
 
 
28
    __requires__ = 'cpython',
29
29
    __only_on__ = 'postgresql+psycopg2'
30
 
    __skip_if__ = lambda : sys.version_info < (2, 4),
 
30
    __skip_if__ = lambda : sys.version_info < (2, 5),
31
31
 
32
32
    def test_baseline_0_setup(self):
33
33
        global metadata
34
34
        creator = testing.db.pool._creator
35
35
        recorder = lambda : dbapi_session.recorder(creator())
36
 
        engine = engines.testing_engine(options={'creator': recorder})
 
36
        engine = engines.testing_engine(options={'creator': recorder, 'use_reaper':False})
37
37
        metadata = MetaData(engine)
38
38
        engine.connect()
39
39
 
358
358
        metadata = MetaData(engine)
359
359
        engine.connect()
360
360
 
361
 
    @profiling.function_call_count(3012, {'2.4': 1827})
 
361
    @profiling.function_call_count(3599, {'2.4': 1711})
362
362
    def test_profile_1_create_tables(self):
363
363
        self.test_baseline_1_create_tables()
364
364
 
365
 
    @profiling.function_call_count(5371, {'2.4': 3650})
 
365
    @profiling.function_call_count(5045, {'2.6':5099, '2.4': 3650, '3.2':4699})
366
366
    def test_profile_1a_populate(self):
367
367
        self.test_baseline_1a_populate()
368
368
 
369
 
    @profiling.function_call_count(259, {'2.4': 186})
 
369
    @profiling.function_call_count(245, {'2.4': 172})
370
370
    def test_profile_2_insert(self):
371
371
        self.test_baseline_2_insert()
372
372
 
373
 
    @profiling.function_call_count(3834, {'2.4': 2347})
 
373
    @profiling.function_call_count(3340, {'2.4': 2158, '2.7':3541, 
 
374
                                        '2.7+cextension':3317, '2.6':3564})
374
375
    def test_profile_3_properties(self):
375
376
        self.test_baseline_3_properties()
376
377
 
377
 
    @profiling.function_call_count(13341, {'2.4': 7963, '2.6+cextension'
378
 
                                   : 12447, '2.7+cextension': 12447},
 
378
    @profiling.function_call_count(11624, {'2.4': 7963, '2.6+cextension'
 
379
                                   : 10736, '2.7+cextension': 10736},
379
380
                                   variance=0.10)
380
381
    def test_profile_4_expressions(self):
381
382
        self.test_baseline_4_expressions()
382
383
 
383
 
    @profiling.function_call_count(1311, {'2.4': 904, '2.6+cextension'
384
 
                                   : 1226, '2.7+cextension': 1226},
 
384
    @profiling.function_call_count(1059, {'2.4': 904, '2.6+cextension'
 
385
                                   : 1027, '2.6.4':1167, '2.7+cextension': 1027},
385
386
                                   variance=0.10)
386
387
    def test_profile_5_aggregates(self):
387
388
        self.test_baseline_5_aggregates()
388
389
 
389
 
    @profiling.function_call_count(1904, {'2.4': 1193})
 
390
    @profiling.function_call_count(1788, {'2.4': 1118, '3.2':1647, 
 
391
                                        '2.7+cextension':1698})
390
392
    def test_profile_6_editing(self):
391
393
        self.test_baseline_6_editing()
392
394
 
393
 
    @profiling.function_call_count(2641, {'2.4': 1673, '2.6+cextension'
394
 
                                   : 2502})
 
395
    @profiling.function_call_count(2252, {'2.4': 1673, 
 
396
                                            '2.6':2412,
 
397
                                            '2.7':2412,
 
398
                                            '2.7+cextension':2110, 
 
399
                                            '2.6+cextension': 2252})
395
400
    def test_profile_7_multiview(self):
396
401
        self.test_baseline_7_multiview()
397
402