add a test which checks the syntax of the pylib on various python versions
--HG-- branch : trunk
This commit is contained in:
		
							parent
							
								
									b930565d56
								
							
						
					
					
						commit
						78d0d4656b
					
				|  | @ -0,0 +1,10 @@ | |||
| import sys | ||||
| 
 | ||||
| fn = sys.argv[1] | ||||
| print("Testing %s" % (fn,)) | ||||
| fp = open(fn, "rb") | ||||
| try: | ||||
|     source = fp.read() | ||||
| finally: | ||||
|     fp.close() | ||||
| compile(source, fn, "exec") | ||||
|  | @ -0,0 +1,19 @@ | |||
| import os | ||||
| import py | ||||
| 
 | ||||
| 
 | ||||
| this_dir = py.path.local(__file__).dirpath() | ||||
| _compile_checker = this_dir.join("check_compile.py") | ||||
| _py_root = this_dir.join("..") | ||||
| del this_dir | ||||
| 
 | ||||
| @py.test.mark.multi(pyversion=("2.4", "2.5", "2.6", "3.1")) | ||||
| def test_syntax(pyversion): | ||||
|     executable = py.path.local.sysfind("python" + pyversion) | ||||
|     if executable is None: | ||||
|         py.test.skip("no python%s found" % (pyversion,)) | ||||
|     for path, dirs, filenames in os.walk(str(_py_root)): | ||||
|         for fn in filenames: | ||||
|             if fn.endswith(".py"): | ||||
|                 full = os.path.join(path, fn) | ||||
|                 executable.sysexec(_compile_checker, full) | ||||
		Loading…
	
		Reference in New Issue