@@ -38,42 +38,6 @@ def run(self):
38
38
gc .enable ()
39
39
print ('\n ' )
40
40
41
- # def test_simple_object(self, providers):
42
- # """Test simple object's creation."""
43
- # class Test(object):
44
- # pass
45
- #
46
- # for x in xrange(int(5000000 * self.duration_factor)):
47
- # Test()
48
- #
49
- # def test_simple_object_factory(self, providers):
50
- # """Test simple object's factory."""
51
- # class Test(object):
52
- # pass
53
- #
54
- # test_factory = providers.Factory(Test)
55
- # for x in xrange(int(5000000 * self.duration_factor)):
56
- # test_factory()
57
- #
58
- # def test_3_ctx_positional_injections(self, providers):
59
- # """Test factory with 3 context positional injections."""
60
- # class Test(object):
61
- # def __init__(self, a, b, c):
62
- # pass
63
- #
64
- # for x in xrange(int(5000000 * self.duration_factor)):
65
- # Test(1, 2, 3)
66
- #
67
- # def test_factory_3_ctx_positional_injections(self, providers):
68
- # """Test factory with 3 context positional injections."""
69
- # class Test(object):
70
- # def __init__(self, a, b, c):
71
- # pass
72
- #
73
- # test_factory = providers.Factory(Test)
74
- # for x in xrange(int(5000000 * self.duration_factor)):
75
- # test_factory(1, 2, 3)
76
-
77
41
def test_raw_3_kw_injections (self , providers ):
78
42
"""Test 3 keyword argument injections."""
79
43
class A (object ):
@@ -143,55 +107,35 @@ def __init__(self, a, b, c):
143
107
for x in xrange (int (5000000 * self .duration_factor )):
144
108
test_factory ()
145
109
146
- # def test_factory_subcls_3_factory_subcls_kw_injections(self, providers):
147
- # """Test factory with 3 keyword argument injections via factories."""
148
- # class MyFactory(providers.Factory):
149
- # pass
150
- #
151
- # class A(object):
152
- # pass
153
- #
154
- # class B(object):
155
- # pass
156
- #
157
- # class C(object):
158
- # pass
159
- #
160
- # class Test(object):
161
- # def __init__(self, a, b, c):
162
- # pass
163
- #
164
- # a_factory = MyFactory(A)
165
- # b_factory = MyFactory(B)
166
- # c_factory = MyFactory(C)
167
- # test_factory = MyFactory(Test,
168
- # a=a_factory,
169
- # b=b_factory,
170
- # c=c_factory)
171
- # for x in xrange(int(5000000 * self.duration_factor)):
172
- # test_factory()
173
-
174
- # def test_singleton(self, providers):
175
- # """Test factory with 3 keyword argument injections via factories."""
176
- # class Test(object):
177
- # def __init__(self):
178
- # pass
179
- #
180
- # test_factory = providers.Singleton(Test)
181
- # for x in xrange(int(5000000 * self.duration_factor)):
182
- # test_factory()
183
- #
184
- # def test_singleton_subcls(self, providers):
185
- # """Test factory with 3 keyword argument injections via factories."""
186
- # class MySingleton(providers.Singleton):
187
- # pass
188
- #
189
- # class Test(object):
190
- # pass
191
- #
192
- # test_factory = MySingleton(Test)
193
- # for x in xrange(int(5000000 * self.duration_factor)):
194
- # test_factory()
110
+ def test_factory_6_factory_kw_injections_0_context (self , providers ):
111
+ """Test factory with 6 keyword argument injections."""
112
+ class Test (object ):
113
+ def __init__ (self , a , b , c , d , e , f ):
114
+ pass
115
+
116
+ test_factory = providers .Factory (Test , a = 1 , b = 2 , c = 3 , d = 4 , e = 5 , f = 6 )
117
+ for x in xrange (int (5000000 * self .duration_factor )):
118
+ test_factory ()
119
+
120
+ def test_factory_6_factory_kw_injections_1_context (self , providers ):
121
+ """Test factory with 6 keyword argument injections."""
122
+ class Test (object ):
123
+ def __init__ (self , a , b , c , d , e , f ):
124
+ pass
125
+
126
+ test_factory = providers .Factory (Test , f = 6 )
127
+ for x in xrange (int (5000000 * self .duration_factor )):
128
+ test_factory (a = 1 , b = 2 , c = 3 , d = 4 , e = 5 )
129
+
130
+ def test_factory_6_factory_kw_injections_3_context (self , providers ):
131
+ """Test factory with 6 keyword argument injections."""
132
+ class Test (object ):
133
+ def __init__ (self , a , b , c , d , e , f ):
134
+ pass
135
+
136
+ test_factory = providers .Factory (Test , a = 1 , b = 2 , c = 3 )
137
+ for x in xrange (int (5000000 * self .duration_factor )):
138
+ test_factory (d = 4 , e = 5 , f = 6 )
195
139
196
140
197
141
if __name__ == '__main__' :
0 commit comments