File: test_sources.py

package info (click to toggle)
codespeak-lib 1.4.8-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 1,032 kB
  • sloc: python: 11,401; makefile: 133
file content (19 lines) | stat: -rw-r--r-- 624 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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)