11import os
22import os .path
33import shutil
4- import subprocess
54import sys
65import textwrap
76import unittest
109from pyperformance import tests
1110
1211
12+ CPYTHON_ONLY = unittest .skipIf (
13+ sys .implementation .name != 'cpython' ,
14+ 'CPython-only' ,
15+ )
16+
17+
1318class FullStackTests (tests .Functional , unittest .TestCase ):
1419
1520 maxDiff = 80 * 100
@@ -24,12 +29,13 @@ def setUpClass(cls):
2429
2530 @classmethod
2631 def ensure_pyperformance (cls ):
27- _ , stdout , _ = cls .run_python (
32+ ec , stdout , _ = cls .run_python (
2833 os .path .join (tests .DATA_DIR , 'find-pyperformance.py' ),
2934 capture = 'stdout' ,
3035 onfail = 'raise' ,
3136 verbose = False ,
3237 )
38+ assert ec == 0 , ec
3339 stdout = stdout .strip ()
3440 if stdout .strip ():
3541 # It is already installed.
@@ -43,7 +49,8 @@ def ensure_pyperformance(cls):
4349 # Install it.
4450 reporoot = os .path .dirname (pyperformance .PKG_ROOT )
4551 # 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
4754
4855 # Clean up extraneous files.
4956 egg_info = "pyperformance.egg-info"
@@ -252,6 +259,7 @@ def create_compile_config(self, *revisions,
252259 outfile .write (text )
253260 return cfgfile
254261
262+ @CPYTHON_ONLY
255263 @unittest .skip ('way too slow' )
256264 def test_compile (self ):
257265 cfgfile = self .create_compile_config ()
@@ -263,6 +271,7 @@ def test_compile(self):
263271 capture = None ,
264272 )
265273
274+ @CPYTHON_ONLY
266275 @unittest .skip ('way too slow' )
267276 def test_compile_all (self ):
268277 rev1 = '2cd268a3a934' # tag: v3.10.1
@@ -275,6 +284,7 @@ def test_compile_all(self):
275284 capture = None ,
276285 )
277286
287+ @CPYTHON_ONLY
278288 @unittest .expectedFailure
279289 def test_upload (self ):
280290 url = '<bogus>'
0 commit comments