1
1
import os
2
2
import os .path
3
3
import shutil
4
- import subprocess
5
4
import sys
6
5
import textwrap
7
6
import unittest
10
9
from pyperformance import tests
11
10
12
11
12
+ CPYTHON_ONLY = unittest .skipIf (
13
+ sys .implementation .name != 'cpython' ,
14
+ 'CPython-only' ,
15
+ )
16
+
17
+
13
18
class FullStackTests (tests .Functional , unittest .TestCase ):
14
19
15
20
maxDiff = 80 * 100
@@ -24,12 +29,13 @@ def setUpClass(cls):
24
29
25
30
@classmethod
26
31
def ensure_pyperformance (cls ):
27
- _ , stdout , _ = cls .run_python (
32
+ ec , stdout , _ = cls .run_python (
28
33
os .path .join (tests .DATA_DIR , 'find-pyperformance.py' ),
29
34
capture = 'stdout' ,
30
35
onfail = 'raise' ,
31
36
verbose = False ,
32
37
)
38
+ assert ec == 0 , ec
33
39
stdout = stdout .strip ()
34
40
if stdout .strip ():
35
41
# It is already installed.
@@ -43,7 +49,8 @@ def ensure_pyperformance(cls):
43
49
# Install it.
44
50
reporoot = os .path .dirname (pyperformance .PKG_ROOT )
45
51
# XXX Ignore the output (and optionally log it).
46
- cls .run_pip ('install' , '--editable' , reporoot )
52
+ ec , _ , _ = cls .run_pip ('install' , '--editable' , reporoot )
53
+ assert ec == 0 , ec
47
54
48
55
# Clean up extraneous files.
49
56
egg_info = "pyperformance.egg-info"
@@ -252,6 +259,7 @@ def create_compile_config(self, *revisions,
252
259
outfile .write (text )
253
260
return cfgfile
254
261
262
+ @CPYTHON_ONLY
255
263
@unittest .skip ('way too slow' )
256
264
def test_compile (self ):
257
265
cfgfile = self .create_compile_config ()
@@ -263,6 +271,7 @@ def test_compile(self):
263
271
capture = None ,
264
272
)
265
273
274
+ @CPYTHON_ONLY
266
275
@unittest .skip ('way too slow' )
267
276
def test_compile_all (self ):
268
277
rev1 = '2cd268a3a934' # tag: v3.10.1
@@ -275,6 +284,7 @@ def test_compile_all(self):
275
284
capture = None ,
276
285
)
277
286
287
+ @CPYTHON_ONLY
278
288
@unittest .expectedFailure
279
289
def test_upload (self ):
280
290
url = '<bogus>'
0 commit comments