9
9
from pyperformance import tests
10
10
11
11
12
- CPYTHON_ONLY = unittest .skipIf (
13
- sys .implementation .name != 'cpython' ,
14
- 'CPython-only' ,
15
- )
16
-
17
-
18
12
class FullStackTests (tests .Functional , unittest .TestCase ):
19
13
20
14
maxDiff = 80 * 100
@@ -108,56 +102,41 @@ def div():
108
102
print ('---' )
109
103
print ()
110
104
105
+ def expect_success (* args ):
106
+ text = self .run_pyperformance (
107
+ * args ,
108
+ capture = None ,
109
+ )
110
+
111
+ def expect_failure (* args ):
112
+ text = self .run_pyperformance (
113
+ * args ,
114
+ capture = None ,
115
+ exitcode = 1 ,
116
+ )
117
+
111
118
# It doesn't exist yet.
112
- self .run_pyperformance (
113
- 'venv' , 'show' , '--venv' , root ,
114
- capture = None ,
115
- )
119
+ expect_success ('venv' , 'show' , '--venv' , root )
116
120
div ()
117
121
# It gets created.
118
- self .run_pyperformance (
119
- 'venv' , 'create' , '--venv' , root ,
120
- capture = None ,
121
- )
122
+ expect_success ('venv' , 'create' , '--venv' , root )
122
123
div ()
123
- self .run_pyperformance (
124
- 'venv' , 'show' , '--venv' , root ,
125
- capture = None ,
126
- )
124
+ expect_success ('venv' , 'show' , '--venv' , root )
127
125
div ()
128
126
# It alraedy exists.
129
- self .run_pyperformance (
130
- 'venv' , 'create' , '--venv' , root ,
131
- capture = None ,
132
- exitcode = 1 ,
133
- )
127
+ expect_failure ('venv' , 'create' , '--venv' , root )
134
128
div ()
135
- self .run_pyperformance (
136
- 'venv' , 'show' , '--venv' , root ,
137
- capture = None ,
138
- )
129
+ expect_success ('venv' , 'show' , '--venv' , root )
139
130
div ()
140
131
# It gets re-created.
141
- self .run_pyperformance (
142
- 'venv' , 'recreate' , '--venv' , root ,
143
- capture = None ,
144
- )
132
+ expect_success ('venv' , 'recreate' , '--venv' , root )
145
133
div ()
146
- self .run_pyperformance (
147
- 'venv' , 'show' , '--venv' , root ,
148
- capture = None ,
149
- )
134
+ expect_success ('venv' , 'show' , '--venv' , root )
150
135
div ()
151
136
# It get deleted.
152
- self .run_pyperformance (
153
- 'venv' , 'remove' , '--venv' , root ,
154
- capture = None ,
155
- )
137
+ expect_success ('venv' , 'remove' , '--venv' , root )
156
138
div ()
157
- self .run_pyperformance (
158
- 'venv' , 'show' , '--venv' , root ,
159
- capture = None ,
160
- )
139
+ expect_success ('venv' , 'show' , '--venv' , root )
161
140
162
141
###################################
163
142
# run
@@ -170,7 +149,7 @@ def test_run_and_show(self):
170
149
# --debug-single-value: benchmark results don't matter, we only
171
150
# check that running benchmarks don't fail.
172
151
# XXX Capture and check the output.
173
- self .run_pyperformance (
152
+ text = self .run_pyperformance (
174
153
'run' ,
175
154
'-b' , 'all' ,
176
155
'--debug-single-value' ,
@@ -259,8 +238,9 @@ def create_compile_config(self, *revisions,
259
238
outfile .write (text )
260
239
return cfgfile
261
240
262
- @CPYTHON_ONLY
263
- @unittest .skip ('way too slow' )
241
+ @tests .CPYTHON_ONLY
242
+ @tests .NON_WINDOWS_ONLY
243
+ @tests .SLOW
264
244
def test_compile (self ):
265
245
cfgfile = self .create_compile_config ()
266
246
revision = 'a58ebcc701dd' # tag: v3.10.2
@@ -271,8 +251,9 @@ def test_compile(self):
271
251
capture = None ,
272
252
)
273
253
274
- @CPYTHON_ONLY
275
- @unittest .skip ('way too slow' )
254
+ @tests .CPYTHON_ONLY
255
+ @tests .NON_WINDOWS_ONLY
256
+ @tests .SLOW
276
257
def test_compile_all (self ):
277
258
rev1 = '2cd268a3a934' # tag: v3.10.1
278
259
rev2 = 'a58ebcc701dd' # tag: v3.10.2
@@ -284,7 +265,8 @@ def test_compile_all(self):
284
265
capture = None ,
285
266
)
286
267
287
- @CPYTHON_ONLY
268
+ @tests .CPYTHON_ONLY
269
+ @tests .NON_WINDOWS_ONLY
288
270
@unittest .expectedFailure
289
271
def test_upload (self ):
290
272
url = '<bogus>'
@@ -387,8 +369,7 @@ def test_compare_wrong_version(self):
387
369
Skipped 1 benchmarks only in py36.json: telco
388
370
389
371
Skipped 1 benchmarks only in py3_performance03.json: call_simple
390
-
391
- ERROR: Performance versions are different: 1.0.1 != 0.3
372
+ ERROR: Performance versions are different (1.0.1 != 0.3)
392
373
''' ).lstrip ())
393
374
394
375
def test_compare_single_value (self ):
0 commit comments