e74bb2d7f0
relax python 2.6 dependency fix regress prodded by and ok jasper@
41 lines
1.5 KiB
Plaintext
41 lines
1.5 KiB
Plaintext
$OpenBSD: patch-test_examples_test_py,v 1.1 2009/09/04 11:44:00 eric Exp $
|
|
--- test/examples_test.py.orig Thu Aug 6 14:47:41 2009
|
|
+++ test/examples_test.py Fri Sep 4 13:32:03 2009
|
|
@@ -1,12 +1,8 @@
|
|
'''test by running example scripts
|
|
'''
|
|
-from __future__ import division # new in 2.2, redundant in 3.0
|
|
-from __future__ import absolute_import # new in 2.5, redundant in 2.7/3.0
|
|
-from __future__ import print_function # new in 2.6, redundant in 3.0
|
|
|
|
import os
|
|
import os.path
|
|
-import subprocess
|
|
|
|
#import py.test as test
|
|
|
|
@@ -16,14 +12,17 @@ def test_examples():
|
|
'''
|
|
os.chdir(os.path.join(os.path.dirname(__file__), '..', 'examples'))
|
|
for f in (x for x in os.listdir('.') if x.endswith('.py')):
|
|
- retcode = subprocess.call('python %s' % f, shell=True)
|
|
- assert retcode == 0, 'Error: {0} retcode == {1}'.format(f, retcode)
|
|
+ os.system('${MODPY_BIN} %s' % f)
|
|
|
|
-
|
|
-def test_snippets_png():
|
|
+def test_snippets():
|
|
'''run all snippets in png mode and check they exit successfully.
|
|
'''
|
|
os.chdir(os.path.join(os.path.dirname(__file__), '..', 'examples',
|
|
'cairo_snippets'))
|
|
- retcode = subprocess.call('python snippets_png.py -s', shell=True)
|
|
- assert retcode == 0, 'Error: retcode == {0}'.format(retcode)
|
|
+ os.system('${MODPY_BIN} snippets_png.py')
|
|
+ os.system('${MODPY_BIN} snippets_ps.py')
|
|
+ os.system('${MODPY_BIN} snippets_pdf.py')
|
|
+ os.system('${MODPY_BIN} snippets_svg.py')
|
|
+
|
|
+test_examples()
|
|
+test_snippets()
|