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

« back to all changes in this revision

Viewing changes to test/aaa_profiling/test_compiler.py

  • Committer: Package Import Robot
  • Author(s): Piotr Ożarowski, Jakub Wilk, Piotr Ożarowski
  • Date: 2013-07-06 20:53:52 UTC
  • mfrom: (1.4.23) (16.1.17 experimental)
  • Revision ID: package-import@ubuntu.com-20130706205352-ryppl1eto3illd79
Tags: 0.8.2-1
[ Jakub Wilk ]
* Use canonical URIs for Vcs-* fields.

[ Piotr Ożarowski ]
* New upstream release
* Upload to unstable
* Build depend on python3-all instead of -dev, extensions are not built for
  Python 3.X 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
from sqlalchemy import *
2
 
from test.lib import *
 
2
from sqlalchemy.testing import *
3
3
from sqlalchemy.engine import default
4
4
 
5
5
class CompileTest(fixtures.TestBase, AssertsExecutionResults):
34
34
 
35
35
        cls.dialect = default.DefaultDialect()
36
36
 
37
 
    @profiling.function_call_count(62)
 
37
    @profiling.function_call_count()
38
38
    def test_insert(self):
39
39
        t1.insert().compile(dialect=self.dialect)
40
40
 
41
 
    @profiling.function_call_count(56)
 
41
    @profiling.function_call_count()
42
42
    def test_update(self):
43
43
        t1.update().compile(dialect=self.dialect)
44
44
 
45
 
    @profiling.function_call_count(110)
46
45
    def test_update_whereclause(self):
47
 
        t1.update().where(t1.c.c2==12).compile(dialect=self.dialect)
48
 
 
49
 
    @profiling.function_call_count(139)
 
46
        t1.update().where(t1.c.c2 == 12).compile(dialect=self.dialect)
 
47
 
 
48
        @profiling.function_call_count()
 
49
        def go():
 
50
            t1.update().where(t1.c.c2 == 12).compile(dialect=self.dialect)
 
51
        go()
 
52
 
50
53
    def test_select(self):
51
 
        s = select([t1], t1.c.c2==t2.c.c1)
52
 
        s.compile(dialect=self.dialect)
53
 
 
 
54
        # give some of the cached type values
 
55
        # a chance to warm up
 
56
        s = select([t1], t1.c.c2 == t2.c.c1)
 
57
        s.compile(dialect=self.dialect)
 
58
 
 
59
        @profiling.function_call_count()
 
60
        def go():
 
61
            s = select([t1], t1.c.c2 == t2.c.c1)
 
62
            s.compile(dialect=self.dialect)
 
63
        go()
 
64
 
 
65
    def test_select_labels(self):
 
66
        # give some of the cached type values
 
67
        # a chance to warm up
 
68
        s = select([t1], t1.c.c2 == t2.c.c1).apply_labels()
 
69
        s.compile(dialect=self.dialect)
 
70
 
 
71
        @profiling.function_call_count()
 
72
        def go():
 
73
            s = select([t1], t1.c.c2 == t2.c.c1).apply_labels()
 
74
            s.compile(dialect=self.dialect)
 
75
        go()
 
 
b'\\ No newline at end of file'